Examples of CQLSSTableWriter


Examples of org.apache.cassandra.io.sstable.CQLSSTableWriter

    this.SSTableWriters.put(CObjectShardList.SHARD_INDEX_TABLE_NAME, Pair.create(this.buildSSTableWriterForShardIndexTable(sorted), (Map<CIndex, CQLSSTableWriter>) null));

    for (String defName : definitions.keySet()) {
      // Build the CQLSSTableWriter for the static table
      CQLSSTableWriter staticWriter = buildSSTableWriterForStaticTable(definitions.get(defName), sorted);

      // Build the CQLSSTableWriter for all the index tables
      List<CIndex> indexes = definitions.get(defName).getIndexesAsList();
      Map<CIndex, CQLSSTableWriter> indexWriters = Maps.newHashMap();
      for (CIndex index : indexes) {
        CQLSSTableWriter writer = buildSSTableWriterForWideTable(definitions.get(defName), index, sorted);
        indexWriters.put(index, writer);
      }
      this.SSTableWriters.put(defName, Pair.create(staticWriter, indexWriters));
    }
  }
View Full Code Here

Examples of org.apache.cassandra.io.sstable.CQLSSTableWriter

      CDefinition definition = definitions.get(tableName);
      // Pull an existing CQLSSTableWriter for this object type if we already have one, if not make a new one
      if (!this.SSTableWriters.containsKey(tableName)) {
        throw new RuntimeException("Tried to write to uninitialized SSTableWriter for static table " + tableName);
      }
      CQLSSTableWriter staticWriter = this.SSTableWriters.get(tableName).left;
      Map<CIndex, CQLSSTableWriter> indexWriters = this.SSTableWriters.get(tableName).right;

      for (Map<String, Object> insert : objects.get(tableName)) {
        staticWriter.addRow(insert);
        for (CIndex index : indexWriters.keySet()) {
          if(definition.isAllowNullPrimaryKeyInserts()){
            //check if we have the necessary primary fields to insert on this index. If not just continue;
            if(!index.validateIndexKeys(index.getIndexKeyAndValues(insert))){
              continue;
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.