Examples of ArrayByteSequence


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

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

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

   * @see #Authorizations(String...)
   */
  public Authorizations(Collection<byte[]> authorizations) {
    ArgumentChecker.notNull(authorizations);
    for (byte[] auth : authorizations)
      auths.add(new ArrayByteSequence(auth));
    checkAuths();
  }
View Full Code Here

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

   * @see #Authorizations(String...)
   */
  public Authorizations(List<ByteBuffer> authorizations) {
    ArgumentChecker.notNull(authorizations);
    for (ByteBuffer buffer : authorizations) {
      auths.add(new ArrayByteSequence(ByteBufferUtil.toBytes(buffer)));
    }
    checkAuths();
  }
View Full Code Here

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

      // it's the new format
      authsString = authsString.substring(HEADER.length());
      if (authsString.length() > 0) {
        for (String encAuth : authsString.split(",")) {
          byte[] auth = Base64.decodeBase64(encAuth.getBytes(Constants.UTF8));
          auths.add(new ArrayByteSequence(auth));
        }
        checkAuths();
      }
    } else {
      // it's the old format
View Full Code Here

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

  private void setAuthorizations(String... authorizations) {
    ArgumentChecker.notNull(authorizations);
    auths.clear();
    for (String str : authorizations) {
      str = str.trim();
      auths.add(new ArrayByteSequence(str.getBytes(Constants.UTF8)));
    }

    checkAuths();
  }
View Full Code Here

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

   * @param auth
   *          authorization, as a string encoded in UTF-8
   * @return true if authorization is in this collection
   */
  public boolean contains(byte[] auth) {
    return auths.contains(new ArrayByteSequence(auth));
  }
View Full Code Here

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

   * @param auth
   *          authorization
   * @return true if authorization is in this collection
   */
  public boolean contains(String auth) {
    return auths.contains(new ArrayByteSequence(auth));
  }
View Full Code Here

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

  }

  static Set<ByteSequence> newCFSet(String... cfs) {
    HashSet<ByteSequence> cfSet = new HashSet<ByteSequence>();
    for (String cf : cfs) {
      cfSet.add(new ArrayByteSequence(cf));
    }
    return cfSet;
  }
View Full Code Here

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

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

    ConditionalWriter cw = conn.createConditionalWriter(table, new ConditionalWriterConfig());

    ArrayList<ByteSequence> rows = new ArrayList<ByteSequence>();

    for (int i = 0; i < 1000; i++) {
      rows.add(new ArrayByteSequence(FastFormat.toZeroPaddedString(abs(rand.nextLong()), 16, 16, new byte[0])));
    }

    ArrayList<ConditionalMutation> mutations = new ArrayList<ConditionalMutation>();

    for (ByteSequence row : rows)
      mutations.add(new Stats(row).toMutation());

    ArrayList<ByteSequence> rows2 = new ArrayList<ByteSequence>();
    Iterator<Result> results = cw.write(mutations.iterator());
    while (results.hasNext()) {
      Result result = results.next();
      Assert.assertEquals(Status.ACCEPTED, result.getStatus());
      rows2.add(new ArrayByteSequence(result.getMutation().getRow()));
    }

    Collections.sort(rows);
    Collections.sort(rows2);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.