当前位置: 首页>>代码示例>>Java>>正文


Java ColumnUpdate.isDeleted方法代码示例

本文整理汇总了Java中org.apache.accumulo.core.data.ColumnUpdate.isDeleted方法的典型用法代码示例。如果您正苦于以下问题:Java ColumnUpdate.isDeleted方法的具体用法?Java ColumnUpdate.isDeleted怎么用?Java ColumnUpdate.isDeleted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.apache.accumulo.core.data.ColumnUpdate的用法示例。


在下文中一共展示了ColumnUpdate.isDeleted方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: write

import org.apache.accumulo.core.data.ColumnUpdate; //导入方法依赖的package包/类
@Override
public void write(Text table, Mutation mutation) throws IOException, InterruptedException {
  TreeMap<Key,Value> buffer = getBuffer(table);
  int mutationSize = 0;
  for (ColumnUpdate update : mutation.getUpdates()) {
    Key k = new Key(mutation.getRow(), update.getColumnFamily(), update.getColumnQualifier(), update.getColumnVisibility(), update.getTimestamp(),
        update.isDeleted());
    Value v = new Value(update.getValue());
    // TODO account for object overhead
    mutationSize += k.getSize();
    mutationSize += v.getSize();
    buffer.put(k, v);
  }
  size += mutationSize;
  long bufferSize = bufferSizes.get(table);
  
  // TODO use a MutableLong instead
  bufferSize += mutationSize;
  bufferSizes.put(table, bufferSize);
  
  while (size >= maxSize) {
    flushLargestTable();
  }
}
 
开发者ID:apache,项目名称:accumulo-wikisearch,代码行数:25,代码来源:BufferingRFileRecordWriter.java

示例2: toThrift

import org.apache.accumulo.core.data.ColumnUpdate; //导入方法依赖的package包/类
public static org.apache.accumulo.proxy.thrift.ColumnUpdate toThrift(ColumnUpdate update) {
  if (update == null) {
    return null;
  }

  org.apache.accumulo.proxy.thrift.ColumnUpdate tcu = new org.apache.accumulo.proxy.thrift.ColumnUpdate();
  tcu.setColFamily(update.getColumnFamily());
  tcu.setColQualifier(update.getColumnQualifier());
  tcu.setColVisibility(update.getColumnVisibility());
  tcu.setTimestamp(update.getTimestamp());
  tcu.setValue(update.getValue());
  // Work around for ACCUMULO-3474
  if (update.isDeleted()) {
    tcu.setDeleteCell(update.isDeleted());
  }
  return tcu;
}
 
开发者ID:JHUAPL,项目名称:accumulo-proxy-instance,代码行数:18,代码来源:ThriftHelper.java

示例3: check

import org.apache.accumulo.core.data.ColumnUpdate; //导入方法依赖的package包/类
/**
 * Ensure mutations pass constraints
 */
public List<Short> check(Environment env, Mutation mutation) {

	// Create a list to hold violation codes
	ArrayList<Short> violations = new ArrayList<Short>();

	// Get the updates from the mutation object
	Collection<ColumnUpdate> updates = mutation.getUpdates();

	// Iterate through each record determining if a record passes
	// constraints
	for (ColumnUpdate columnUpdate : updates) {
		// Ignore any record that contains a delete
		if (!columnUpdate.isDeleted()) {
			// If the record is greater than the maximum value, add a
			// violation code to the list of violations
			if (Long.parseLong(new String(columnUpdate.getValue())) >= maxValue) {
				violations.add(MAX_VALUE_EXCEEDED);
			}
		}
	}

	// Return the list of violation codes
	return violations;
}
 
开发者ID:adamjshook,项目名称:accumulo-training,代码行数:28,代码来源:CustomConstraint.java

示例4: addMutation

import org.apache.accumulo.core.data.ColumnUpdate; //导入方法依赖的package包/类
/**
 * Signs the given mutation and then write it to Accumulo.
 *
 * @param mutation
 *          The mutation to sign.
 */
@Override
public void addMutation(Mutation mutation) throws MutationsRejectedException {
  Mutation signedMutation = new Mutation(mutation.getRow());

  // Sign the entries.
  for (ColumnUpdate update : mutation.getUpdates()) {
    if (update.isDeleted()) {
      if (signatureConfig.destination == Destination.COLUMN_VISIBILITY) {
        throw new IllegalArgumentException("cannot delete entries when the signature is stored in the column visibility");
      }

      if (update.hasTimestamp()) {
        signedMutation.putDelete(update.getColumnFamily(), update.getColumnQualifier(), new ColumnVisibility(update.getColumnVisibility()),
            update.getTimestamp());
      } else {
        signedMutation.putDelete(update.getColumnFamily(), update.getColumnQualifier(), new ColumnVisibility(update.getColumnVisibility()));
      }
    } else {
      Entry<Key,Value> signedEntry = signer.sign(new MutableEntry(mutation.getRow(), update).toEntry(), update.hasTimestamp());
      Key signedKey = signedEntry.getKey();

      if (update.hasTimestamp()) {
        signedMutation.put(signedKey.getColumnFamily(), signedKey.getColumnQualifier(), signedKey.getColumnVisibilityParsed(), signedKey.getTimestamp(),
            signedEntry.getValue());
      } else {
        signedMutation.put(signedKey.getColumnFamily(), signedKey.getColumnQualifier(), signedKey.getColumnVisibilityParsed(), signedEntry.getValue());
      }
    }
  }

  // Write the signed mutations.
  if (signatureTableWriter != null) {
    tableWriter.addMutation(mutation);
    signatureTableWriter.addMutation(signedMutation);
  } else {
    tableWriter.addMutation(signedMutation);
  }
}
 
开发者ID:mit-ll,项目名称:PACE,代码行数:45,代码来源:SignedBatchWriter.java

示例5: MutableEntry

import org.apache.accumulo.core.data.ColumnUpdate; //导入方法依赖的package包/类
/**
 * Creates a mutable entry for the given update.
 *
 * @param row
 *          The row that is being updated.
 * @param update
 *          Update to wrap.
 */
public MutableEntry(byte[] row, ColumnUpdate update) {
  this.row = row;
  this.colF = update.getColumnFamily();
  this.colQ = update.getColumnQualifier();
  this.colVis = update.getColumnVisibility();
  this.timestamp = update.getTimestamp();
  this.delete = update.isDeleted();
  this.value = update.getValue();
}
 
开发者ID:mit-ll,项目名称:PACE,代码行数:18,代码来源:MutableEntry.java


注:本文中的org.apache.accumulo.core.data.ColumnUpdate.isDeleted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。