use of com.ms.silverking.cloud.dht.client.DHTSession in project SilverKing by Morgan-Stanley.
the class DebugKey method replicaContainsKey.
private boolean replicaContainsKey(IPAndPort replica, String key) throws ClientException {
DHTSession dhtSession;
SynchronousNamespacePerspective<String, byte[]> nsp;
RetrievalOptions ro;
StoredValue<byte[]> storedValue;
dhtSession = dhtClient.openSession(new SessionOptions(gc, replica.getIPAsString()));
nsp = dhtSession.openSyncNamespacePerspective(namespace, String.class, byte[].class);
ro = nsp.getNamespace().getOptions().getDefaultGetOptions();
ro = ro.retrievalType(RetrievalType.META_DATA);
ro = ro.forwardingMode(ForwardingMode.DO_NOT_FORWARD);
ro = ro.nonExistenceResponse(NonExistenceResponse.NULL_VALUE);
storedValue = nsp.retrieve(key, ro);
nsp.close();
dhtSession.close();
if (storedValue == null) {
return false;
} else {
// out.println(storedValue.getMetaData());
return true;
}
}
use of com.ms.silverking.cloud.dht.client.DHTSession in project SilverKing by Morgan-Stanley.
the class SingleVersionUnrestrictedRevisionsTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws ClientException, IOException {
DHTSession session = createSession();
Namespace ns = createNamespace(session, namespaceName, SINGLE_VERSION, UNRESTRICTED_REVISIONS);
syncNsp = ns.openSyncPerspective(String.class, String.class);
}
use of com.ms.silverking.cloud.dht.client.DHTSession in project SilverKing by Morgan-Stanley.
the class ClientSpecifiedVersionNoRevisionsTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws ClientException, IOException {
DHTSession session = createSession();
Namespace ns = createNamespace(session, namespaceName, CLIENT_SPECIFIED, NO_REVISIONS);
syncNsp = ns.openSyncPerspective(String.class, String.class);
}
use of com.ms.silverking.cloud.dht.client.DHTSession in project SilverKing by Morgan-Stanley.
the class SingleVersionNoRevisionsTest method setUpBeforeClass.
@BeforeClass
public static void setUpBeforeClass() throws ClientException, IOException {
DHTSession session = createSession();
Namespace ns = createNamespace(session, namespaceName, SINGLE_VERSION, NO_REVISIONS);
syncNsp = ns.openSyncPerspective(String.class, String.class);
}
Aggregations