Package org.apache.accumulo.core.data

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


    this.key = key;
   
    fieldsSame = 0;
    fieldsPrefixed = 0;
   
    ByteSequence prevKeyScratch;
    ByteSequence keyScratch;
   
    if (prevKey != null) {
     
      prevKeyScratch = prevKey.getRowData();
      keyScratch = key.getRowData();
View Full Code Here


    // this method mostly avoids object allocation and only does compares when the row changes
   
    MByteSequence row, cf, cq, cv;
    MByteSequence prow, pcf, pcq, pcv;
   
    ByteSequence stopRow = seekKey.getRowData();
    ByteSequence stopCF = seekKey.getColumnFamilyData();
    ByteSequence stopCQ = seekKey.getColumnQualifierData();
   
    long ts = -1;
    long pts = -1;
    boolean pdel = false;
   
View Full Code Here

 
  public static Set<ByteSequence> decodeColumnFamilies(String colFams) throws LocalityGroupConfigurationError {
    HashSet<ByteSequence> colFamsSet = new HashSet<ByteSequence>();
   
    for (String family : colFams.split(",")) {
      ByteSequence cfbs = decodeColumnFamily(family);
      colFamsSet.add(cfbs);
    }
   
    return colFamsSet;
  }
View Full Code Here

   *          the key to test
   * @return {@code true} if the key is visible or iterator is not scanning, and {@code false} if not
   */
  protected boolean canSee(Key key) {
    // Ensure that the visibility (which could have been transformed) parses. Must always do this check, even if visibility is not evaluated.
    ByteSequence visibility = key.getColumnVisibilityData();
    ColumnVisibility colVis = null;
    Boolean parsed = (Boolean) parsedVisibilitiesCache.get(visibility);
    if (parsed == null) {
      try {
        colVis = new ColumnVisibility(visibility.toArray());
        parsedVisibilitiesCache.put(visibility, Boolean.TRUE);
      } catch (BadArgumentException e) {
        log.error("Parse error after transformation : " + visibility);
        parsedVisibilitiesCache.put(visibility, Boolean.FALSE);
        if (scanning) {
          return false;
        } else {
          throw e;
        }
      }
    } else if (!parsed) {
      if (scanning)
        return false;
      else
        throw new IllegalStateException();
    }
   
    Boolean visible = canSeeColumnFamily(key);
   
    if (!scanning || !visible || ve == null || visibleCache == null || visibility.length() == 0)
      return visible;
   
    visible = (Boolean) visibleCache.get(visibility);
    if (visible == null) {
      try {
        if (colVis == null)
          colVis = new ColumnVisibility(visibility.toArray());
        visible = ve.evaluate(colVis);
        visibleCache.put(visibility, visible);
      } catch (VisibilityParseException e) {
        log.error("Parse Error", e);
        visible = Boolean.FALSE;
View Full Code Here

   * @return {@code true} if {@code key}'s column family is one of those fetched in the set passed to our {@link #seek(Range, Collection, boolean)} method
   */
  protected boolean canSeeColumnFamily(Key key) {
    boolean visible = true;
    if (seekColumnFamilies != null) {
      ByteSequence columnFamily = key.getColumnFamilyData();
      if (seekColumnFamiliesInclusive)
        visible = seekColumnFamilies.contains(columnFamily);
      else
        visible = !seekColumnFamilies.contains(columnFamily);
    }
View Full Code Here

  public boolean schemaExists() {
    return conn.tableOperations().exists(mapping.tableName);
  }

  public ByteSequence populate(Iterator<Entry<Key,Value>> iter, T persistent) throws IOException {
    ByteSequence row = null;

    Map<Utf8, Object> currentMap = null;
    List currentArray = null;
    Text currentFam = null;
    int currentPos = 0;
View Full Code Here

      scanner.setRange(rowRange);
      setFetchColumns(scanner, fields);

      T persistent = newPersistent();
      ByteSequence row = populate(scanner.iterator(), persistent);
      if (row == null)
        return null;
      return persistent;
    } catch (TableNotFoundException e) {
      LOG.error(e.getMessage(), e);
View Full Code Here

  public boolean schemaExists() throws IOException {
    return conn.tableOperations().exists(mapping.tableName);
  }

  public ByteSequence populate(Iterator<Entry<Key,Value>> iter, T persistent) throws IOException {
    ByteSequence row = null;
   
    Map currentMap = null;
    ArrayList currentArray = null;
    Text currentFam = null;
    int currentPos = 0;
View Full Code Here

     
      scanner.setRange(rowRange);
      setFetchColumns(scanner, fields);
     
      T persistent = newPersistent();
      ByteSequence row = populate(scanner.iterator(), persistent);
      if (row == null)
        return null;
      return persistent;
    } catch (TableNotFoundException e) {
      return null;
View Full Code Here

      return false;
   
    key = null;
   
    Iterator<Entry<Key,Value>> nextRow = iterator.next();
    ByteSequence row = getDataStore().populate(nextRow, persistent);
    key = (K) ((AccumuloStore) dataStore).fromBytes(getKeyClass(), row.toArray());
   
    return true;
  }
View Full Code Here

TOP

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

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.