Examples of CKeyspaceDefinition


Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();
    cm.setLogCql(true);

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "SimpleKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setLogCql(true);

    List<Map<String, Object>> values = this.getNValues(1, index1Value, index2Value);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setLogCql(true);

    //Insert our test data
    List<Map<String, Object>> values = JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(), "NullIndexValuesTestData.js");
    Map<String, Object> object = values.get(0);
    Long createdAt = (Long)(object.get("created_at"));
    logger.debug("Inserting audit with created_at: {}", createdAt);
    UUID id = (UUID)om.insert("object_audit", JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")), createdAt);

    //Get back the data and make sure things match
    Map<String, Object> result = om.getByKey("object_audit", id);

    //Update the object
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setLogCql(true);

    //Insert our test data
    List<Map<String, Object>> values = JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(), "NullIndexValuesTestData.js");
    Map<String, Object> object = values.get(0);
    Long createdAt = (Long)(object.get("created_at"));
    logger.debug("Inserting audit with created_at: {}", createdAt);
    UUID id = (UUID)om.insert("object_audit", JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")), createdAt);

    //Update the object
    object.put("object_id", "00000003-0000-0030-0040-000000040000");
    om.update("object_audit", id, JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")));

    //Get back the data and make sure things match
    Map<String, Object> result = om.getByKey("object_audit", id);
    assertNotNull(result);
    assertEquals(null, result.get("user_id"));
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setLogCql(true);

    //Insert our test data
    List<Map<String, Object>> values = JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(), "NullIndexValuesTestData.js");
    Map<String, Object> object = values.get(0);
    Long createdAt = (Long)(object.get("created_at"));
    logger.debug("Inserting audit with created_at: {}", createdAt);
    UUID id = (UUID)om.insert("object_audit", JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")), createdAt);

    //Update the object
    object.put("changes", null);
    om.update("object_audit", id, JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")));

    //Get back the data and make sure things match
    Map<String, Object> result = om.getByKey("object_audit", id);
    assertNotNull(result);
    assertEquals(null, result.get("changes"));
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setLogCql(true);

    //Insert our test data
    Map<String, Object> values = Maps.newHashMap();
    values.put("account_id", "00000003-0000-0030-0040-000000030000");
    values.put("object_type", "Account");
    values.put("object_id", "00000003-0000-0030-0040-000000030000");
    values.put("source_type", null);
    values.put("source_id", null);
    values.put("user_id", null);
    values.put("changes", "{\"Website\":{\"f\":\"http://www.somesite1.com\",\"t\":\"http://www.somesite2.com\"}}");

    UUID id = UUIDs.timeBased();
    om.update("object_audit", id, JsonUtil.rhombusMapFromJsonMap(values,definition.getDefinitions().get("object_audit")));

    //Get back the data and make sure things match
    Map<String, Object> result = om.getByKey("object_audit", id);
    assertNotNull(result);
    assertEquals("Account", result.get("object_type"));
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setExecuteAsync(true);

    //Insert our test data
    List<Map<String, Object>> values = JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(), "DateRangeQueryTestData.js");
    for(Map<String, Object> object : values) {
      Long createdAt = (Long)(object.get("created_at"));
      logger.debug("Inserting audit with created_at: {}", createdAt);
      om.insert("object_audit", JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")), createdAt);
    }

    cm.teardown();
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    ObjectMapper om = cm.getObjectMapper();
    om.setExecuteAsync(false);

    //Insert our test data
    List<Map<String, Object>> values = JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(), "DateRangeQueryTestData.js");
    for(Map<String, Object> object : values) {
      Long createdAt = (Long)(object.get("created_at"));
      logger.debug("Inserting audit with created_at: {}", createdAt);
      om.insert("object_audit", JsonUtil.rhombusMapFromJsonMap(object,definition.getDefinitions().get("object_audit")), createdAt);
    }

    cm.teardown();
  }
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "CCMTestData.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    ObjectMapper om = cm.buildKeyspace(definition, true);
    cm.setDefaultKeyspace(definition);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

    //Build the connection manager
    ConnectionManager cm = getConnectionManager();

    //Build our keyspace definition object
    CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "AuditKeyspace.js");
    assertNotNull(definition);

    //Rebuild the keyspace and get the object mapper
    cm.buildKeyspace(definition, true);
    logger.debug("Built keyspace: {}", definition.getName());
    cm.setDefaultKeyspace(definition);
    final ObjectMapper om = cm.getObjectMapper();

    final int numThreads = 10;
    final ExecutorService executorService = Executors.newFixedThreadPool(numThreads);
    List<Map<String, Object>> values = JsonUtil.rhombusMapFromResource(this.getClass().getClassLoader(), "DateRangeQueryTestData.js");
    final CDefinition objectAuditDef = definition.getDefinitions().get("object_audit");

    //Run through the inserts a few times and get a total time to execute
    long startTime = System.currentTimeMillis();
    for(int i = 0 ; i < 100 ; i++) {
      insertObjectSetAsync(numThreads, executorService, om, values, objectAuditDef);
View Full Code Here

Examples of com.pardot.rhombus.cobject.CKeyspaceDefinition

  {
    Long wideRowsPerIndex = 2L;
    Long totalObjectsPerWideRange = 100L;
    Long totalObjectsPerShard = 10L;

    CKeyspaceDefinition ckdef = CKeyspaceDefinition.fromJsonFile("ShardedKeyspace.js");
    Map<String, CDefinition> cdefs = ckdef.getDefinitions();
    Integer totalIndexCount = 0;

    for (String cdefKey : cdefs.keySet()) {
      totalIndexCount += cdefs.get(cdefKey).getIndexes().size();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.