Exemplo n.º 1
0
    private static void DumpNARP(string narp)
    {
        NeoVirtFSVolumes.EnsureNarpVolumeExists(db, narp);

        // Just the beginning path (maybe we'll support the leading / but we're doing the normalized version)

        var volume = $"NARP/{narp}";

        if (narp.StartsWith("Mirror", StringComparison.InvariantCulture) ||
            narp.StartsWith("IA-", StringComparison.InvariantCulture))
        {
            volume = $"MIRRORS/{narp}";
        }

        //var rootOfVolume = NeoVirtFS.EnsureVolumeSetUpProperly(db, volume);

        Console.WriteLine($"Scan Physical: {narp}");
        //Console.WriteLine($"Volume Root: {rootOfVolume}");

        var scan = ScanFileDirectory.RecursiveScan($"/NARP/{narp}/".ToSpan(), narp.ToSpan());

        dumpPhysical(scan, narp);
    }
Exemplo n.º 2
0
    private static void AssimilateNarp(string narp, ImportNARPOptions a)
    {
        if (a.SkipIfDone && isMarkAssimilated(narp))
        {
            Console.WriteLine($"NARP: {narp} already assimilated");
            return;
        }

        NeoVirtFSVolumes.EnsureNarpVolumeExists(db, narp);

        // Just the beginning path (maybe we'll support the leading / but we're doing the normalized version)

        var volume = $"NARP/{narp}";

        if (narp.StartsWith("Mirror", StringComparison.InvariantCulture) ||
            narp.StartsWith("IA-", StringComparison.InvariantCulture))
        {
            volume = $"MIRRORS/{narp}";
        }

        var rootOfVolume = NeoAssets.Mongo.NeoVirtFS.EnsureVolumeSetUpProperly(db, volume);

        Console.WriteLine($"Scan Physical: {narp}");
        Console.WriteLine($"Volume Root: {rootOfVolume}");

        Console.WriteLine($"Assimilate/Import NARP {narp} - map to {volume} - Volume Id {rootOfVolume}");

        var scan = ScanFileDirectory.RecursiveScan($"/NARP/{narp}/".ToSpan(), narp.ToSpan());

        Console.WriteLine("Loaded: Assimilating");

        dumpPhysical(scan, narp);

        Assimilate(scan, 0, null, rootOfVolume);

        MarkAssimilated(narp);
    }