Package org.apache.accumulo.core.data

Examples of org.apache.accumulo.core.data.ArrayByteSequence


    ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(ski1);
   
    imm.delete(0);
   
    ArrayList<ByteSequence> columns = new ArrayList<ByteSequence>();
    columns.add(new ArrayByteSequence("bar"));
   
    // this seek resulted in an infinite loop before a bug was fixed
    cfsi.seek(new Range("r1"), columns, true);
   
    assertFalse(cfsi.hasTop());
View Full Code Here


      throw new RuntimeException(e);
    }
   
    final Set<ByteSequence> colfs = new TreeSet<ByteSequence>();
    for (Column c : this.getFetchedColumns()) {
      colfs.add(new ArrayByteSequence(c.getColumnFamily()));
    }
   
    try {
      skvi.seek(range, colfs, true);
    } catch (IOException e) {
View Full Code Here

  public static final Set<ByteSequence> EMPTY_CF_SET = Collections.emptySet();
 
  public static Set<ByteSequence> families(Collection<Column> columns) {
    Set<ByteSequence> result = new HashSet<ByteSequence>(columns.size());
    for (Column col : columns) {
      result.add(new ArrayByteSequence(col.getColumnFamily()));
    }
    return result;
  }
View Full Code Here

        output[pos++] = (byte) (0xff & c);
      }
     
    }
   
    return new ArrayByteSequence(output, 0, pos);
   
  }
View Full Code Here

      if (expression[start] == '"') {
        // its a quoted term
        int qStart = start + 1;
        int qEnd = end - 1;
       
        return new ArrayByteSequence(expression, qStart, qEnd - qStart);
      }
      return new ArrayByteSequence(expression, start, end - start);
    }
View Full Code Here

    if (options.containsKey(indexFamilyOptionName))
      indexColf = new Text(options.get(indexFamilyOptionName));
    if (options.containsKey(docFamilyOptionName))
      docColf = new Text(options.get(docFamilyOptionName));
    docSource = source.deepCopy(env);
    indexColfSet = Collections.singleton((ByteSequence) new ArrayByteSequence(indexColf.getBytes(), 0, indexColf.getLength()));
   
    for (TermSource ts : this.sources) {
      ts.seekColfams = indexColfSet;
    }
  }
View Full Code Here

    if (zeroIndex < 0)
      throw new IllegalArgumentException("bad current docID");
    Text colf = new Text(docColf);
    colf.append(nullByte, 0, 1);
    colf.append(currentDocID.getBytes(), 0, zeroIndex);
    docColfSet = Collections.singleton((ByteSequence) new ArrayByteSequence(colf.getBytes(), 0, colf.getLength()));
    if (log.isTraceEnabled())
      log.trace(zeroIndex + " " + currentDocID.getLength());
    Text colq = new Text();
    colq.set(currentDocID.getBytes(), zeroIndex + 1, currentDocID.getLength() - zeroIndex - 1);
    Key k = new Key(currentPartition, colf, colq);
View Full Code Here

    try {
      Map<String,Set<ByteSequence>> groups = LocalityGroupUtil.getLocalityGroups(conf);
      Assert.assertEquals(1, groups.size());
      Assert.assertNotNull(groups.get("lg1"));
      Assert.assertEquals(2, groups.get("lg1").size());
      Assert.assertTrue(groups.get("lg1").contains(new ArrayByteSequence("cf1")));
    } catch (LocalityGroupConfigurationError err) {
      Assert.fail();
    }
    try {
      conf.set("table.group.lg2", "cf1");
View Full Code Here

    for (int i = 0; i < 256; i++) {
      test1[i] = (byte) (0xff & i);
      test2[i] = (byte) (0xff & (255 - i));
    }
   
    ArrayByteSequence bs1 = new ArrayByteSequence(test1);
   
    String ecf = LocalityGroupUtil.encodeColumnFamily(bs1);
   
    // System.out.println(ecf);
   
    ByteSequence bs2 = LocalityGroupUtil.decodeColumnFamily(ecf);
   
    Assert.assertEquals(bs1, bs2);
    Assert.assertEquals(ecf, LocalityGroupUtil.encodeColumnFamily(bs2));
   
    // test encoding multiple column fams containing binary data
    HashSet<Text> in = new HashSet<Text>();
    HashSet<ByteSequence> in2 = new HashSet<ByteSequence>();
    in.add(new Text(test1));
    in2.add(new ArrayByteSequence(test1));
    in.add(new Text(test2));
    in2.add(new ArrayByteSequence(test2));
    Set<ByteSequence> out = LocalityGroupUtil.decodeColumnFamilies(LocalityGroupUtil.encodeColumnFamilies(in));
   
    Assert.assertEquals(in2, out);
  }
View Full Code Here

    ColumnFamilySkippingIterator cfsi = new ColumnFamilySkippingIterator(ski1);
   
    imm.delete(0);
   
    ArrayList<ByteSequence> columns = new ArrayList<ByteSequence>();
    columns.add(new ArrayByteSequence("bar"));
   
    // this seek resulted in an infinite loop before a bug was fixed
    cfsi.seek(new Range("r1"), columns, true);
   
    assertFalse(cfsi.hasTop());
View Full Code Here

TOP

Related Classes of org.apache.accumulo.core.data.ArrayByteSequence

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.