本文整理汇总了Java中org.apache.gora.goraci.generated.Flushed类的典型用法代码示例。如果您正苦于以下问题:Java Flushed类的具体用法?Java Flushed怎么用?Java Flushed使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Flushed类属于org.apache.gora.goraci.generated包,在下文中一共展示了Flushed类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: readFlushed
import org.apache.gora.goraci.generated.Flushed; //导入依赖的package包/类
private void readFlushed(Configuration conf) throws Exception {
DataStore<Utf8,Flushed> flushedTable = DataStoreFactory.getDataStore(Utf8.class, Flushed.class, conf);
Query<Utf8,Flushed> query = flushedTable.newQuery();
Result<Utf8,Flushed> result = flushedTable.execute(query);
ArrayList<String> flushedEntries = new ArrayList<>();
while (result.next()) {
flushedEntries.add(result.getKey() + ":" + result.get().getCount());
}
conf.setStrings("org.apache.gora.goraci.verify.flushed", flushedEntries.toArray(new String[] {}));
flushedTable.close();
}
示例2: map
import org.apache.gora.goraci.generated.Flushed; //导入依赖的package包/类
@Override
protected void map(LongWritable key, NullWritable value, Context output) throws IOException {
long num = key.get();
LOG.info("num {}", num);
Utf8 id = new Utf8(UUID.randomUUID().toString());
Configuration conf = new Configuration();
DataStore<Long,CINode> store = DataStoreFactory.getDataStore(Long.class, CINode.class, conf);
DataStore<Utf8,Flushed> flushedTable = null;
if (concurrent) {
flushedTable = DataStoreFactory.getDataStore(Utf8.class, Flushed.class, conf);
flushedTable.createSchema();
}
store.createSchema();
Random rand = new Random();
long[] first = null;
long[] prev = null;
long[] current = new long[WIDTH];
long count = 0;
while (count < num) {
for (int i = 0; i < current.length; i++)
current[i] = Math.abs(rand.nextLong());
persist(output, store, count, prev, current, id);
if (first == null)
first = current;
prev = current;
current = new long[WIDTH];
count += current.length;
output.setStatus("Count " + count);
if (count % WRAP == 0) {
// this block of code turns the 1 million linked list of length 25 into one giant circular linked list of 25 million
circularLeftShift(first);
updatePrev(store, first, prev);
if (concurrent) {
// keep track of whats flushed in another table, verify can use this info to run concurrently
Flushed flushed = flushedTable.newPersistent();
flushed.setCount(count);
flushedTable.put(id, flushed);
flushedTable.flush();
}
first = null;
prev = null;
}
}
store.close();
if (concurrent)
flushedTable.close();
}