use of com.ms.silverking.cloud.dht.NamespaceOptions in project SilverKing by Morgan-Stanley.
the class FileSegmentUtil method debugFiles.
public static void debugFiles(DHTKey key, File nsDir, int minSegment, int maxSegment) throws IOException {
NamespaceOptions nsOptions;
nsOptions = readNamespaceOptions(nsDir);
for (int i = minSegment; i <= maxSegment; i++) {
try {
new FileSegmentUtil().debugSegment(key, nsDir, i, nsOptions);
} catch (FileNotFoundException fnfe) {
System.out.printf("Ignoring FileNotFoundException for segment %d\n", i);
} catch (Exception e) {
e.printStackTrace();
}
}
}
use of com.ms.silverking.cloud.dht.NamespaceOptions in project SilverKing by Morgan-Stanley.
the class NamespaceOptionsClient method verifyNamespaceOptions.
private boolean verifyNamespaceOptions(long namespace, NamespaceOptions nsOptions) throws RetrievalException {
NamespaceOptions existingOptions;
if (debug) {
System.out.printf("verifyNamespaceOptions(%x, %s)\n", namespace, nsOptions);
}
existingOptions = getNamespaceOptions(namespace);
if (debug) {
System.out.println("Done verifyNamespaceOptions");
}
return existingOptions.equals(nsOptions);
}
use of com.ms.silverking.cloud.dht.NamespaceOptions in project SilverKing by Morgan-Stanley.
the class NamespaceOptionsClient method verifyNamespaceProperties.
private boolean verifyNamespaceProperties(long namespace, NamespaceProperties nsProperties) throws RetrievalException {
NamespaceOptions existingProperties;
if (debug) {
System.out.printf("verifyNamespaceProperties(%x, %s)\n", namespace, nsProperties);
}
existingProperties = getNamespaceOptions(namespace);
if (debug) {
System.out.println("Done verifyNamespaceProperties");
}
if (existingProperties == null) {
throw new NamespaceNotCreatedException("No existing properties found");
}
return existingProperties.equals(nsProperties);
}
use of com.ms.silverking.cloud.dht.NamespaceOptions in project SilverKing by Morgan-Stanley.
the class SilverKingClient method doGetNamespaceOptions.
private void doGetNamespaceOptions(String[] args) throws OperationException, IOException {
String name;
NamespaceOptions nsOptions;
opMessage("Getting namespace options");
name = args[0];
nsOptions = null;
sw.reset();
for (int i = 0; i < reps; i++) {
try {
nsOptions = session.getNamespace(name).getOptions();
} catch (NamespaceNotCreatedException nnce) {
err.printf("No such namespace: %s\n", name);
}
}
sw.stop();
if (nsOptions != null) {
out.println(nsOptions);
}
}
use of com.ms.silverking.cloud.dht.NamespaceOptions in project SilverKing by Morgan-Stanley.
the class SilverKingClient method doCloneNamespace.
private void doCloneNamespace(String[] args) throws OperationException, IOException {
String name;
NamespaceOptions nsOptions;
long version;
nsOptions = syncNSP.getNamespace().getOptions();
switch(nsOptions.getVersionMode()) {
case SEQUENTIAL:
System.out.println("clone currently not supported for NamespaceVersionMode.SEQUENTIAL");
return;
case CLIENT_SPECIFIED:
if (args.length > 1) {
version = Long.parseLong(args[1]);
} else {
version = System.currentTimeMillis();
out.printf("No version specified. Using System.currentTimeMillis() %d %s\n", version, new Date(version).toString());
}
break;
default:
version = Long.MIN_VALUE;
break;
}
name = args[0];
out.println(version == Long.MIN_VALUE ? "No version passed" : "Passing version: " + version);
opMessage("Cloning namespace");
sw.reset();
if (version == Long.MIN_VALUE) {
syncNSP.getNamespace().clone(name);
} else {
syncNSP.getNamespace().clone(name, version);
}
sw.stop();
}
Aggregations