use of com.ms.silverking.cloud.dht.client.Namespace in project SilverKing by Morgan-Stanley.
the class PerspectiveTest method test_NamespaceOptions_vs_NamespacePerspectiveOptions.
// @Test
public void test_NamespaceOptions_vs_NamespacePerspectiveOptions() throws ClientException, IOException {
Namespace ns = session.createNamespace(namespaceName, session.getDefaultNamespaceOptions().versionMode(NamespaceVersionMode.CLIENT_SPECIFIED).revisionMode(RevisionMode.UNRESTRICTED_REVISIONS));
SynchronousNamespacePerspective<String, String> syncNSPString = ns.openSyncPerspective(String.class, String.class);
SynchronousNamespacePerspective<String, Integer> syncNSPInt = ns.openSyncPerspective(String.class, Integer.class);
PutOptions poString = syncNSPString.getOptions().getDefaultPutOptions();
GetOptions goString = syncNSPString.getOptions().getDefaultGetOptions();
PutOptions poInt = syncNSPInt.getOptions().getDefaultPutOptions();
GetOptions goInt = syncNSPInt.getOptions().getDefaultGetOptions();
syncNSPString.put("k", "v1", poString.version(1));
syncNSPInt.put("k", 2, poInt.version(2));
System.out.println(syncNSPString);
System.out.println(syncNSPString.get("k"));
System.out.println(syncNSPString.get("k", goString.versionConstraint(VersionConstraint.exactMatch(1))).getValue());
System.out.println("-");
System.out.println(syncNSPInt.get("k"));
System.out.println(syncNSPInt.get("k", goInt.versionConstraint(VersionConstraint.exactMatch(2))).getValue());
System.out.println(syncNSPInt.get("k", goInt.versionConstraint(VersionConstraint.exactMatch(1))).getValue());
}
use of com.ms.silverking.cloud.dht.client.Namespace 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.Namespace 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.Namespace 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