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);
}
}
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));
}
Aggregations