Package com.thinkaurelius.titan.diskstorage.indexing

Examples of com.thinkaurelius.titan.diskstorage.indexing.IndexMutation


    for (Map.Entry<String, Map<String, IndexMutation>> stores : mutations.entrySet()) {
      String store = stores.getKey();
      String tableName = getTableName(store);
      for (Map.Entry<String, IndexMutation> entry : stores.getValue().entrySet()) {
        String rowId = entry.getKey();
        IndexMutation mutation = entry.getValue();

        RowMutation rowMutation = new RowMutation();
        rowMutation.setRowId(rowId);
        rowMutation.setTable(tableName);
        rowMutation.setWal(_wal);
        rowMutation.setWaitToBeVisible(_waitToBeVisible);
        mutationBatch.add(rowMutation);

        if (mutation.isDeleted()) {
          rowMutation.setRowMutationType(RowMutationType.DELETE_ROW);
          continue;
        }

        RecordMutation recordMutation = new RecordMutation().setRecordMutationType(RecordMutationType.REPLACE_COLUMNS);
        Record record = new Record().setFamily(getFamily(store)).setRecordId(rowId);

        rowMutation.addToRecordMutations(recordMutation);
        rowMutation.setRowMutationType(RowMutationType.UPDATE_ROW);

        if (mutation.hasAdditions()) {
          for (IndexEntry indexEntry : mutation.getAdditions()) {
            record.addToColumns(new Column(indexEntry.key, getValue(indexEntry.value)));
          }
        }
        if (mutation.hasDeletions()) {
          for (IndexEntry indexEntry : mutation.getAdditions()) {
            record.addToColumns(new Column(indexEntry.key, null));
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of com.thinkaurelius.titan.diskstorage.indexing.IndexMutation

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.