本文整理汇总了Java中org.apache.accumulo.core.data.ArrayByteSequence类的典型用法代码示例。如果您正苦于以下问题:Java ArrayByteSequence类的具体用法?Java ArrayByteSequence怎么用?Java ArrayByteSequence使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ArrayByteSequence类属于org.apache.accumulo.core.data包,在下文中一共展示了ArrayByteSequence类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: TermSource
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
public TermSource(SortedKeyValueIterator<Key,Value> iter, Text dataLocation, Text term, boolean notFlag) {
this.iter = iter;
this.dataLocation = dataLocation;
ByteSequence bs = new ArrayByteSequence(dataLocation.getBytes(), 0, dataLocation.getLength());
this.seekColumnFamilies = Collections.singletonList(bs);
this.term = term;
this.notFlag = notFlag;
}
开发者ID:apache,项目名称:accumulo-wikisearch,代码行数:9,代码来源:AndIterator.java
示例2: TermSource
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
public TermSource(SortedKeyValueIterator<Key, Value> iter, TextColumn column) {
this.iter = iter;
this.column = column;
this.term = column.getColumnFamily();
this.termCond = column.getColumnQualifier();
this.currentCQ = new Text(emptyByteArray);
this.seekColfams = Collections.<ByteSequence> singletonList(new ArrayByteSequence(term
.getBytes(), 0, term.getLength()));
}
开发者ID:apache,项目名称:incubator-rya,代码行数:12,代码来源:DocumentIndexIntersectingIterator.java
示例3: TermSource
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
public TermSource(final SortedKeyValueIterator<Key, Value> iter, final Text term, final boolean notFlag) {
this.iter = iter;
this.term = term;
this.notFlag = notFlag;
// The desired column families for this source is the term itself
// handle the case where the term is null.
if (term == null) {
this.seekColfams = Collections.<ByteSequence> emptyList();
} else {
this.seekColfams = Collections.<ByteSequence> singletonList(new ArrayByteSequence(term.getBytes(), 0, term.getLength()));
}
}
开发者ID:apache,项目名称:incubator-rya,代码行数:14,代码来源:AndingIterator.java
示例4: testByteSequence
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
@Test
public void testByteSequence() {
String s2 = "test2";
ByteSequence bs2 = new ArrayByteSequence(s2);
Bytes b2 = ByteUtil.toBytes(bs2);
Assert.assertEquals(Bytes.of(s2), b2);
Assert.assertEquals(bs2, ByteUtil.toByteSequence(b2));
}
开发者ID:apache,项目名称:fluo,代码行数:9,代码来源:ByteUtilTest.java
示例5: TermSource
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
public TermSource(SortedKeyValueIterator<Key, Value> iter, Text dataLocation, Text term, boolean notFlag) {
this.iter = iter;
this.dataLocation = dataLocation;
ByteSequence bs = new ArrayByteSequence(dataLocation.getBytes(), 0, dataLocation.getLength());
this.seekColumnFamilies = Collections.singletonList(bs);
this.term = term;
this.notFlag = notFlag;
}
开发者ID:calrissian,项目名称:accumulo-recipes,代码行数:9,代码来源:AndIterator.java
示例6: init
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
private void init() throws IOException {
final AccumuloTablet accumuloTablet = (AccumuloTablet) partition;
LOGGER.info("Initialising RFileReaderIterator for files {}", StringUtils.join(accumuloTablet.getFiles(), ','));
final AccumuloConfiguration accumuloConfiguration = SiteConfiguration.getInstance(DefaultConfiguration.getInstance());
// Required column families according to the configuration
final Set<ByteSequence> requiredColumnFamilies = InputConfigurator
.getFetchedColumns(AccumuloInputFormat.class, configuration)
.stream()
.map(Pair::getFirst)
.map(c -> new ArrayByteSequence(c.toString()))
.collect(Collectors.toSet());
LOGGER.info("RFileReaderIterator will read column families of {}", StringUtils.join(requiredColumnFamilies, ','));
// Column families
final List<SortedKeyValueIterator<Key, Value>> iterators = new ArrayList<>();
for (final String filename : accumuloTablet.getFiles()) {
final Path path = new Path(filename);
final FileSystem fs = path.getFileSystem(configuration);
final RFile.Reader rFileReader = new RFile.Reader(
new CachableBlockFile.Reader(fs, path, configuration, null, null, accumuloConfiguration));
iterators.add(rFileReader);
}
mergedIterator = new MultiIterator(iterators, true);
// Apply visibility filtering iterator
if (null != auths) {
final Authorizations authorizations = new Authorizations(auths.toArray(new String[auths.size()]));
final VisibilityFilter visibilityFilter = new VisibilityFilter(mergedIterator, authorizations, new byte[]{});
final IteratorSetting visibilityIteratorSetting = new IteratorSetting(1, "auth", VisibilityFilter.class);
visibilityFilter.init(mergedIterator, visibilityIteratorSetting.getOptions(), null);
iteratorAfterIterators = visibilityFilter;
LOGGER.info("Set authorizations to {}", authorizations);
} else {
iteratorAfterIterators = mergedIterator;
}
// Apply iterator stack
final List<IteratorSetting> iteratorSettings = getIteratorSettings();
iteratorSettings.sort(Comparator.comparingInt(IteratorSetting::getPriority));
for (final IteratorSetting is : iteratorSettings) {
iteratorAfterIterators = applyIterator(iteratorAfterIterators, is);
}
taskContext.addTaskCompletionListener(context -> close());
final Range range = new Range(accumuloTablet.getStartRow(), true, accumuloTablet.getEndRow(), false);
iteratorAfterIterators.seek(range, requiredColumnFamilies, true);
LOGGER.info("Initialised iterator");
}
开发者ID:gchq,项目名称:Gaffer,代码行数:52,代码来源:RFileReaderIterator.java
示例7: toByteSequence
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
/**
* Convert from Bytes to ByteSequence
*/
public static ByteSequence toByteSequence(Bytes b) {
return new ArrayByteSequence(b.toArray());
}
开发者ID:apache,项目名称:fluo,代码行数:7,代码来源:ByteUtil.java
示例8: shouldProcess
import org.apache.accumulo.core.data.ArrayByteSequence; //导入依赖的package包/类
@VisibleForTesting
static boolean shouldProcess(Notification notification, int divisor, int remainder) {
byte[] cfcq = NotificationUtil.encodeCol(notification.getColumn());
return NotificationHashFilter.accept(ByteUtil.toByteSequence(notification.getRow()),
new ArrayByteSequence(cfcq), divisor, remainder);
}
开发者ID:apache,项目名称:fluo,代码行数:7,代码来源:PartitionManager.java
注:本文中的org.apache.accumulo.core.data.ArrayByteSequence类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论