Search in sources :

Example 1 with DataSegmentWalker

use of com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalker 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)

Example 2 with DataSegmentWalker

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

the class KeySearcher method searchSegment.

public void searchSegment(File nsDir, int segmentNumber) throws IOException {
    ByteBuffer dataBuf;
    out.printf("Searching %s %d\n", nsDir, segmentNumber);
    dataBuf = FileSegment.getDataSegment(nsDir, segmentNumber, nsOptions.getSegmentSize());
    searchSegment(new DataSegmentWalker(dataBuf));
}
Also used : DataSegmentWalker(com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalker) ByteBuffer(java.nio.ByteBuffer)

Aggregations

DataSegmentWalker (com.ms.silverking.cloud.dht.daemon.storage.DataSegmentWalker)2 ByteBuffer (java.nio.ByteBuffer)2 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