本文整理汇总了Java中org.apache.accumulo.core.iterators.SortedKeyValueIterator.deepCopy方法的典型用法代码示例。如果您正苦于以下问题:Java SortedKeyValueIterator.deepCopy方法的具体用法?Java SortedKeyValueIterator.deepCopy怎么用?Java SortedKeyValueIterator.deepCopy使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.accumulo.core.iterators.SortedKeyValueIterator
的用法示例。
在下文中一共展示了SortedKeyValueIterator.deepCopy方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: runTest
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
private void runTest(boolean reseek, TreeMap<Key,Value> source, TreeMap<Key,Value> result, Collection<ByteSequence> cols) throws IOException {
MapIterator src = new MapIterator(source);
SortedKeyValueIterator<Key,Value> iter = new ChunkCombiner();
iter.init(src, null, null);
iter = iter.deepCopy(null);
iter.seek(new Range(), cols, true);
TreeMap<Key,Value> seen = new TreeMap<>();
while (iter.hasTop()) {
assertFalse("already contains " + iter.getTopKey(), seen.containsKey(iter.getTopKey()));
seen.put(new Key(iter.getTopKey()), new Value(iter.getTopValue()));
if (reseek)
iter.seek(new Range(iter.getTopKey().followingKey(PartialKey.ROW_COLFAM_COLQUAL), true, null, true), cols, true);
else
iter.next();
}
assertEquals(result, seen);
}
示例2: addSource
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void addSource(SortedKeyValueIterator<Key,Value> source, IteratorEnvironment env, Text dataLocation, Text term, boolean notFlag) {
// Check if we have space for the added Source
if (sources == null) {
sources = new TermSource[1];
} else {
// allocate space for node, and copy current tree.
// TODO: Should we change this to an ArrayList so that we can just add() ?
TermSource[] localSources = new TermSource[sources.length + 1];
int currSource = 0;
for (TermSource myTerm : sources) {
// TODO: Do I need to call new here? or can I just re-use the term?
localSources[currSource] = new TermSource(myTerm);
currSource++;
}
sources = localSources;
}
sources[sourcesCount] = new TermSource(source.deepCopy(env), dataLocation, term, notFlag);
sourcesCount++;
}
示例3: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
TextColumn[] terms = decodeColumns(options.get(columnOptionName));
boolean[] prefixes = decodeBooleans(options.get(columnPrefix));
ctxt = decodeContext(options.get(context));
if(ctxt != null) {
hasContext = true;
}
if (terms.length < 2) {
throw new IllegalArgumentException("IntersectionIterator requires two or more columns families");
}
sources = new TermSource[terms.length];
sources[0] = new TermSource(source, terms[0]);
for (int i = 1; i < terms.length; i++) {
//log.info("For decoded column " + i + " column family is " + terms[i].getColumnFamily() + " and qualifier is " + terms[i].getColumnQualifier());
sources[i] = new TermSource(source.deepCopy(env), terms[i]);
sources[i].isPrefix = prefixes[i];
}
sourcesCount = terms.length;
}
示例4: addSource
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void addSource(SortedKeyValueIterator<Key,Value> source, IteratorEnvironment env, TextColumn column) {
// Check if we have space for the added Source
if (sources == null) {
sources = new TermSource[1];
} else {
// allocate space for node, and copy current tree.
// TODO: Should we change this to an ArrayList so that we can just add() ? - ACCUMULO-1309
TermSource[] localSources = new TermSource[sources.length + 1];
int currSource = 0;
for (TermSource myTerm : sources) {
// TODO: Do I need to call new here? or can I just re-use the term? - ACCUMULO-1309
localSources[currSource] = new TermSource(myTerm);
currSource++;
}
sources = localSources;
}
sources[sourcesCount] = new TermSource(source.deepCopy(env), column);
sourcesCount++;
}
示例5: addSource
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void addSource(final SortedKeyValueIterator<Key, Value> source, final IteratorEnvironment env, final Text term, final boolean notFlag) {
// Check if we have space for the added Source
if (sources == null) {
sources = new TermSource[1];
} else {
// allocate space for node, and copy current tree.
// TODO: Should we change this to an ArrayList so that we can just add() ?
final TermSource[] localSources = new TermSource[sources.length + 1];
int currSource = 0;
for (final TermSource myTerm : sources) {
// TODO: Do I need to call new here? or can I just re-use the term?
localSources[currSource] = new TermSource(myTerm);
currSource++;
}
sources = localSources;
}
sources[sourcesCount] = new TermSource(source.deepCopy(env), term, notFlag);
sourcesCount++;
}
示例6: addSource
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void addSource(SortedKeyValueIterator<Key, Value> source, IteratorEnvironment env, Text dataLocation, Text term, boolean notFlag) {
// Check if we have space for the added Source
if (sources == null) {
sources = new TermSource[1];
} else {
// allocate space for node, and copy current tree.
// TODO: Should we change this to an ArrayList so that we can just add() ?
TermSource[] localSources = new TermSource[sources.length + 1];
int currSource = 0;
for (TermSource myTerm : sources) {
// TODO: Do I need to call new here? or can I just re-use the term?
localSources[currSource] = new TermSource(myTerm);
currSource++;
}
sources = localSources;
}
sources[sourcesCount] = new TermSource(source.deepCopy(env), dataLocation, term, notFlag);
sourcesCount++;
}
示例7: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void init(SortedKeyValueIterator<Key, Value> source, java.util.Map<String, String> options,
IteratorEnvironment env) throws IOException {
super.init(source, options, env);
sourceItr = source.deepCopy(env);
this.typeRegistry = getTypeRegistry(options);
this.writable = new EventWritable();
}
示例8: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
this.source = source;
this.refsSource = source.deepCopy(env);
}
示例9: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
if (log.isDebugEnabled()) {
log.debug("In AndIterator.init()");
}
Text[] dataLocations = decodeColumns(options.get(columnFamiliesOptionName));
Text[] terms = decodeTermValues(options.get(termValuesOptionName));
boolean[] notFlags = decodeBooleans(options.get(notFlagsOptionName));
if (terms.length < 2) {
throw new IllegalArgumentException("AndIterator requires two or more columns families");
}
// Scan the not flags.
// There must be at least one term that isn't negated
// And we are going to re-order such that the first term is not a ! term
if (notFlags == null) {
notFlags = new boolean[terms.length];
for (int i = 0; i < terms.length; i++) {
notFlags[i] = false;
}
}
// Make sure that the first dataLocation/Term is not a NOT by swapping it with a later dataLocation/Term
if (notFlags[0]) {
for (int i = 1; i < notFlags.length; i++) {
if (notFlags[i] == false) {
// Swap the terms
Text swap = new Text(terms[0]);
terms[0].set(terms[i]);
terms[i].set(swap);
// Swap the dataLocations
swap.set(dataLocations[0]);
dataLocations[0].set(dataLocations[i]);
dataLocations[i].set(swap);
// Flip the notFlags
notFlags[0] = false;
notFlags[i] = true;
break;
}
}
if (notFlags[0]) {
throw new IllegalArgumentException("AndIterator requires at least one column family without not");
}
}
// Build up the array of sources that are to be intersected
sources = new TermSource[dataLocations.length];
for (int i = 0; i < dataLocations.length; i++) {
sources[i] = new TermSource(source.deepCopy(env), dataLocations[i], terms[i], notFlags[i]);
}
sourcesCount = dataLocations.length;
}
示例10: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
@Override
public void init(final SortedKeyValueIterator<Key, Value> source, final Map<String, String> options, final IteratorEnvironment env) throws IOException {
final Text[] terms = decodeColumns(options.get(columnFamiliesOptionName));
boolean[] notFlag = decodeBooleans(options.get(notFlagOptionName));
if (terms.length < 2) {
throw new IllegalArgumentException("IntersectionIterator requires two or more columns families");
}
// Scan the not flags.
// There must be at least one term that isn't negated
// And we are going to re-order such that the first term is not a ! term
if (notFlag == null) {
notFlag = new boolean[terms.length];
for (int i = 0; i < terms.length; i++) {
notFlag[i] = false;
}
}
if (notFlag[0]) {
for (int i = 1; i < notFlag.length; i++) {
if (notFlag[i] == false) {
final Text swapFamily = new Text(terms[0]);
terms[0].set(terms[i]);
terms[i].set(swapFamily);
notFlag[0] = false;
notFlag[i] = true;
break;
}
}
if (notFlag[0]) {
throw new IllegalArgumentException("IntersectionIterator requires at lest one column family without not");
}
}
sources = new TermSource[terms.length];
sources[0] = new TermSource(source, terms[0]);
for (int i = 1; i < terms.length; i++) {
sources[i] = new TermSource(source.deepCopy(env), terms[i], notFlag[i]);
}
sourcesCount = terms.length;
}
示例11: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
public void init(SortedKeyValueIterator<Key, Value> source, Map<String, String> options, IteratorEnvironment env) throws IOException {
if (log.isDebugEnabled()) {
log.debug("In AndIterator.init()");
}
Text[] dataLocations = decodeColumns(options.get(columnFamiliesOptionName));
Text[] terms = decodeTermValues(options.get(termValuesOptionName));
boolean[] notFlags = decodeBooleans(options.get(notFlagsOptionName));
if (terms.length < 2) {
throw new IllegalArgumentException("AndIterator requires two or more columns families");
}
// Scan the not flags.
// There must be at least one term that isn't negated
// And we are going to re-order such that the first term is not a ! term
if (notFlags == null) {
notFlags = new boolean[terms.length];
for (int i = 0; i < terms.length; i++) {
notFlags[i] = false;
}
}
// Make sure that the first dataLocation/Term is not a NOT by swapping it with a later dataLocation/Term
if (notFlags[0]) {
for (int i = 1; i < notFlags.length; i++) {
if (notFlags[i] == false) {
// Swap the terms
Text swap = new Text(terms[0]);
terms[0].set(terms[i]);
terms[i].set(swap);
// Swap the dataLocations
swap.set(dataLocations[0]);
dataLocations[0].set(dataLocations[i]);
dataLocations[i].set(swap);
// Flip the notFlags
notFlags[0] = false;
notFlags[i] = true;
break;
}
}
if (notFlags[0]) {
throw new IllegalArgumentException("AndIterator requires at least one column family without not");
}
}
// Build up the array of sources that are to be intersected
sources = new TermSource[dataLocations.length];
for (int i = 0; i < dataLocations.length; i++) {
sources[i] = new TermSource(source.deepCopy(env), dataLocations[i], terms[i], notFlags[i]);
}
sourcesCount = dataLocations.length;
}
示例12: init
import org.apache.accumulo.core.iterators.SortedKeyValueIterator; //导入方法依赖的package包/类
@Override
public void init(SortedKeyValueIterator<Key,Value> source, Map<String,String> options, IteratorEnvironment env) throws IOException {
super.init(source, options, env);
IteratorEnvironment sampleEnv = env.cloneWithSamplingEnabled();
setMax(sampleEnv, options);
SortedKeyValueIterator<Key,Value> sampleDC = source.deepCopy(sampleEnv);
sampleII = new IntersectingIterator();
sampleII.init(sampleDC, options, env);
}