Package com.pardot.rhombus

Examples of com.pardot.rhombus.ObjectMapper


    //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");
View Full Code Here


      CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "MultiInsertKeyspace.js");

      //Rebuild the keyspace and get the object mapper
      cm.buildKeyspace(definition, true);

      ObjectMapper om = cm.getObjectMapper(definition);
      om.setLogCql(true);

      int nDataItems = 1;

      List<Map<String, Object>> values2 = generateNObjects(nDataItems);

      List<Map<String, Object>> updatedValues2 = Lists.newArrayList();
      for (Map<String, Object> baseValue : values2) {
        updatedValues2.add(JsonUtil.rhombusMapFromJsonMap(baseValue, definition.getDefinitions().get("object2")));
      }

      Map<String, List<Map<String, Object>>> multiInsertMap = Maps.newHashMap();
      multiInsertMap.put("object2", updatedValues2);

      //Insert data
      om.insertBatchMixed(multiInsertMap);

      // generate a executorIterator
      SortedMap<String, Object> indexValues = Maps.newTreeMap();
      indexValues.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      indexValues.put("user_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
View Full Code Here

      CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "MultiInsertKeyspace.js");

      //Rebuild the keyspace and get the object mapper
      cm.buildKeyspace(definition, true);

      ObjectMapper om = cm.getObjectMapper(definition);
      om.setLogCql(true);

      // Set up test data
      // we will insert 200 objects
      int nDataItems = 200;

      List<Map<String, Object>> values2 = generateNObjects(nDataItems);

      List<Map<String, Object>> updatedValues2 = Lists.newArrayList();
      for (Map<String, Object> baseValue : values2) {
        updatedValues2.add(JsonUtil.rhombusMapFromJsonMap(baseValue, definition.getDefinitions().get("object2")));
      }

      Map<String, List<Map<String, Object>>> multiInsertMap = Maps.newHashMap();
      multiInsertMap.put("object2", updatedValues2);

      //Insert data
      om.insertBatchMixed(multiInsertMap);

      // generate a executorIterator
      SortedMap<String, Object> indexValues = Maps.newTreeMap();
      indexValues.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      indexValues.put("user_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
View Full Code Here

      CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "MultiInsertKeyspace.js");

      //Rebuild the keyspace and get the object mapper
      cm.buildKeyspace(definition, true);

      ObjectMapper om = cm.getObjectMapper(definition);
      om.setLogCql(true);

      // Set up test data
      // we will insert 20 objects
      int nDataItems = 20;

      List<Map<String, Object>> values2 = generateNObjects(nDataItems);

      List<Map<String, Object>> updatedValues2 = Lists.newArrayList();
      for (Map<String, Object> baseValue : values2) {
        updatedValues2.add(JsonUtil.rhombusMapFromJsonMap(baseValue, definition.getDefinitions().get("object2")));
      }

      Map<String, List<Map<String, Object>>> multiInsertMap = Maps.newHashMap();
      multiInsertMap.put(objectType, updatedValues2);

      //Insert data
      om.insertBatchMixed(multiInsertMap);

      // generate a executorIterator
      SortedMap<String, Object> indexValues = Maps.newTreeMap();
      indexValues.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      indexValues.put("user_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      Criteria criteria = new Criteria();
      criteria.setIndexKeys(indexValues);

      CObjectCQLGenerator cqlGenerator = om.getCqlGenerator_ONLY_FOR_TESTING();
      CQLStatementIterator unBoundedIterator = cqlGenerator.makeCQLforList(objectType, criteria, false);

      Session session = cm.getRhombusSession(definition);
      CQLExecutor cqlExecutor = new CQLExecutor(session, true, definition.getConsistencyLevel());
      CQLExecutorIterator cqlExecutorIterator = new CQLExecutorIterator(cqlExecutor, unBoundedIterator);
View Full Code Here

      CKeyspaceDefinition definition = JsonUtil.objectFromJsonResource(CKeyspaceDefinition.class, this.getClass().getClassLoader(), "MultiInsertKeyspace.js");

      //Rebuild the keyspace and get the object mapper
      cm.buildKeyspace(definition, true);

      ObjectMapper om = cm.getObjectMapper(definition);
      om.setLogCql(true);

      // Set up test data
      // we will insert 200 objects
      int nDataItems = 200;

      List<Map<String, Object>> values2 = generateNObjects(nDataItems);

      List<Map<String, Object>> updatedValues2 = Lists.newArrayList();
      for (Map<String, Object> baseValue : values2) {
        updatedValues2.add(JsonUtil.rhombusMapFromJsonMap(baseValue, definition.getDefinitions().get("object2")));
      }

      Map<String, List<Map<String, Object>>> multiInsertMap = Maps.newHashMap();
      multiInsertMap.put("object2", updatedValues2);

      //Insert data
      om.insertBatchMixed(multiInsertMap);

      // generate a executorIterator
      SortedMap<String, Object> indexValues = Maps.newTreeMap();
      indexValues.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      indexValues.put("user_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
View Full Code Here

TOP

Related Classes of com.pardot.rhombus.ObjectMapper

Copyright © 2018 www.massapicom. 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.