本文整理了Java中org.apache.accumulo.core.data.Key.setTimestamp()
方法的一些代码示例,展示了Key.setTimestamp()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Key.setTimestamp()
方法的具体详情如下:
包路径:org.apache.accumulo.core.data.Key
类名称:Key
方法名:setTimestamp
[英]Sets the timestamp.
[中]设置时间戳。
代码示例来源:origin: apache/accumulo
@Override
public Key getTopKey() {
Key key = source.getTopKey();
key.setTimestamp(time);
return key;
}
代码示例来源:origin: apache/accumulo
returnKey.colQualifier = colQualifier;
returnKey.colVisibility = colVisibility;
returnKey.setTimestamp(timestamp - 1);
returnKey.deleted = false;
break;
代码示例来源:origin: apache/accumulo
public static Range minimizeEndKeyTimeStamp(Range range) {
Range seekRange = range;
if (range.getEndKey() != null) {
Key seekKey = seekRange.getEndKey();
if (range.getEndKey().getTimestamp() != Long.MIN_VALUE) {
seekKey = new Key(seekRange.getEndKey());
seekKey.setTimestamp(Long.MIN_VALUE);
seekRange = new Range(range.getStartKey(), range.isStartKeyInclusive(), seekKey, true);
} else if (!range.isEndKeyInclusive()) {
seekRange = new Range(range.getStartKey(), range.isStartKeyInclusive(), seekKey, true);
}
}
return seekRange;
}
代码示例来源:origin: apache/accumulo
public static Range maximizeStartKeyTimeStamp(Range range) {
Range seekRange = range;
if (range.getStartKey() != null) {
Key seekKey = range.getStartKey();
if (range.getStartKey().getTimestamp() != Long.MAX_VALUE) {
seekKey = new Key(seekRange.getStartKey());
seekKey.setTimestamp(Long.MAX_VALUE);
seekRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
} else if (!range.isStartKeyInclusive()) {
seekRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
}
}
return seekRange;
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
@Override
public Key getTopKey() {
Key key = source.getTopKey();
key.setTimestamp(time);
return key;
}
代码示例来源:origin: apache/fluo
/**
* @param pos Position of the Key that will be retrieved
* @return The key at a given position
*/
public Key getKey(int pos) {
Key tmpKey = new Key(key);
tmpKey.setTimestamp(timeStamps.get(pos));
return tmpKey;
}
代码示例来源:origin: org.apache.fluo/fluo-core
for (Entry<Key, Value> entry : locks) {
Key start = new Key(entry.getKey());
start.setTimestamp(Long.MAX_VALUE);
Key end = new Key(entry.getKey());
end.setTimestamp(Long.MIN_VALUE);
rangesToScan.add(new Range(start, true, end, true));
代码示例来源:origin: apache/fluo
for (Entry<Key, Value> entry : locks) {
Key start = new Key(entry.getKey());
start.setTimestamp(Long.MAX_VALUE);
Key end = new Key(entry.getKey());
end.setTimestamp(Long.MIN_VALUE);
rangesToScan.add(new Range(start, true, end, true));
代码示例来源:origin: org.apache.fluo/fluo-core
Key start = SpanUtil.toKey(new RowColumn(e1.getKey(), col));
Key end = new Key(start);
end.setTimestamp(ColumnConstants.LOCK_PREFIX | ColumnConstants.TIMESTAMP_MASK);
ranges.add(new Range(start, true, end, false));
代码示例来源:origin: apache/fluo
Key start = SpanUtil.toKey(new RowColumn(e1.getKey(), col));
Key end = new Key(start);
end.setTimestamp(ColumnType.LOCK.first());
ranges.add(new Range(start, true, end, false));
代码示例来源:origin: org.apache.accumulo/accumulo-core
returnKey.colQualifier = colQualifier;
returnKey.colVisibility = colVisibility;
returnKey.setTimestamp(timestamp - 1);
returnKey.deleted = false;
break;
代码示例来源:origin: org.apache.accumulo/accumulo-core
synchronized void addMutation(Mutation m) {
if (m.size() == 0)
throw new IllegalArgumentException("Can not add empty mutations");
long now = System.currentTimeMillis();
mutationCount++;
for (ColumnUpdate u : m.getUpdates()) {
Key key = new Key(m.getRow(), 0, m.getRow().length, u.getColumnFamily(), 0,
u.getColumnFamily().length, u.getColumnQualifier(), 0, u.getColumnQualifier().length,
u.getColumnVisibility(), 0, u.getColumnVisibility().length, u.getTimestamp());
if (u.isDeleted())
key.setDeleted(true);
if (!u.hasTimestamp())
if (timeType.equals(TimeType.LOGICAL))
key.setTimestamp(mutationCount);
else
key.setTimestamp(now);
table.put(new MockMemKey(key, mutationCount), new Value(u.getValue()));
}
}
代码示例来源:origin: org.apache.fluo/fluo-core
ParallelSnapshotScanner(Collection<RowColumn> cells, Environment env, long startTs, TxStats stats,
Map<Bytes, Set<Column>> readLocksSeen) {
for (RowColumn rc : cells) {
byte[] r = rc.getRow().toArray();
byte[] cf = rc.getColumn().getFamily().toArray();
byte[] cq = rc.getColumn().getQualifier().toArray();
byte[] cv = rc.getColumn().getVisibility().toArray();
Key start = new Key(r, cf, cq, cv, Long.MAX_VALUE, false, false);
Key end = new Key(start);
end.setTimestamp(Long.MIN_VALUE);
rangesToScan.add(new Range(start, true, end, true));
}
this.rows = null;
this.env = env;
this.startTs = startTs;
this.stats = stats;
this.rowConverter = ByteUtil::toBytes;
this.columnConverter = ColumnUtil::convert;
this.readLocksSeen = readLocksSeen;
}
代码示例来源:origin: apache/fluo
ParallelSnapshotScanner(Collection<RowColumn> cells, Environment env, long startTs, TxStats stats,
Map<Bytes, Set<Column>> readLocksSeen) {
for (RowColumn rc : cells) {
byte[] r = rc.getRow().toArray();
byte[] cf = rc.getColumn().getFamily().toArray();
byte[] cq = rc.getColumn().getQualifier().toArray();
byte[] cv = rc.getColumn().getVisibility().toArray();
Key start = new Key(r, cf, cq, cv, Long.MAX_VALUE, false, false);
Key end = new Key(start);
end.setTimestamp(Long.MIN_VALUE);
rangesToScan.add(new Range(start, true, end, true));
}
this.rows = null;
this.env = env;
this.startTs = startTs;
this.stats = stats;
this.rowConverter = ByteUtil::toBytes;
this.columnConverter = ColumnUtil::convert;
this.readLocksSeen = readLocksSeen;
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
public static Range minimizeEndKeyTimeStamp(Range range) {
Range seekRange = range;
if (range.getEndKey() != null) {
Key seekKey = seekRange.getEndKey();
if (range.getEndKey().getTimestamp() != Long.MIN_VALUE) {
seekKey = new Key(seekRange.getEndKey());
seekKey.setTimestamp(Long.MIN_VALUE);
seekRange = new Range(range.getStartKey(), range.isStartKeyInclusive(), seekKey, true);
} else if (!range.isEndKeyInclusive()) {
seekRange = new Range(range.getStartKey(), range.isStartKeyInclusive(), seekKey, true);
}
}
return seekRange;
}
代码示例来源:origin: org.apache.accumulo/accumulo-core
public static Range maximizeStartKeyTimeStamp(Range range) {
Range seekRange = range;
if (range.getStartKey() != null) {
Key seekKey = range.getStartKey();
if (range.getStartKey().getTimestamp() != Long.MAX_VALUE) {
seekKey = new Key(seekRange.getStartKey());
seekKey.setTimestamp(Long.MAX_VALUE);
seekRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
} else if (!range.isStartKeyInclusive()) {
seekRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
}
}
return seekRange;
}
代码示例来源:origin: apache/fluo
public void skipToTimestamp(Key curCol, long timestamp) throws IOException {
source.next();
int count = 0;
while (source.hasTop()
&& curCol.equals(source.getTopKey(), PartialKey.ROW_COLFAM_COLQUAL_COLVIS)
&& timestamp < source.getTopKey().getTimestamp()) {
if (count == 10) {
// seek to prefix
Key seekKey = new Key(curCol);
seekKey.setTimestamp(timestamp);
Range newRange = new Range(seekKey, true, range.getEndKey(), range.isEndKeyInclusive());
seek(newRange);
break;
}
source.next();
count++;
}
}
代码示例来源:origin: io.fluo/fluo-core
startKey.setTimestamp(ColumnConstants.ACK_PREFIX
| (Long.MAX_VALUE & ColumnConstants.TIMESTAMP_MASK));
endKey.setTimestamp(ColumnConstants.ACK_PREFIX | (notification.getTimestamp() + 1));
代码示例来源:origin: org.apache.fluo/fluo-core
startKey.setTimestamp(
ColumnConstants.ACK_PREFIX | (Long.MAX_VALUE & ColumnConstants.TIMESTAMP_MASK));
endKey.setTimestamp(ColumnConstants.ACK_PREFIX | (notification.getTimestamp() + 1));
代码示例来源:origin: apache/fluo
startKey.setTimestamp(ColumnType.ACK.first());
endKey.setTimestamp(ColumnType.ACK.encode(notification.getTimestamp() + 1));
内容来源于网络,如有侵权,请联系作者删除!