Search in sources :

Example 1 with DataSegmentWalkEntry

use of com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalkEntry in project SilverKing by Morgan-Stanley.

the class DataMigrationTool method walk.

public void walk(File nsDir, File ssDir, int segmentNumber) throws IOException {
    ByteBuffer dataBuf;
    DataSegmentWalker dsWalker;
    NamespaceProperties nsProperties;
    NamespaceOptions nsOptions;
    nsProperties = NamespacePropertiesIO.read(nsDir);
    nsOptions = nsProperties.getOptions();
    dataBuf = FileSegment.getDataSegment(nsDir, segmentNumber, nsOptions.getSegmentSize());
    dsWalker = new DataSegmentWalker(dataBuf);
    while (dsWalker.hasNext()) {
        DataSegmentWalkEntry entry;
        entry = dsWalker.next();
        System.out.println(entry.getOffset() + " " + entry);
        migrateEntry(entry, ssDir);
    }
}
Also used : NamespaceOptions(com.ms.silverking.cloud.dht.NamespaceOptions) DataSegmentWalkEntry(com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalkEntry) NamespaceProperties(com.ms.silverking.cloud.dht.common.NamespaceProperties) DataSegmentWalker(com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalker) ByteBuffer(java.nio.ByteBuffer)

Aggregations

NamespaceOptions (com.ms.silverking.cloud.dht.NamespaceOptions)1 NamespaceProperties (com.ms.silverking.cloud.dht.common.NamespaceProperties)1 DataSegmentWalkEntry (com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalkEntry)1 DataSegmentWalker (com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalker)1 ByteBuffer (java.nio.ByteBuffer)1