本文整理汇总了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();
}
}
示例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;
}
示例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;
}
示例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);
}
}
示例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();
}