Package org.apache.hadoop.hbase.io

Examples of org.apache.hadoop.hbase.io.ImmutableBytesWritable


   */
  public void testOutOfRangeMidkeyHalfMapFile() throws Exception {
    MapFile.Reader top = null;
    MapFile.Reader bottom = null;
    HStoreKey key = new HStoreKey();
    ImmutableBytesWritable value = new ImmutableBytesWritable();
    Path p = writeMapFile(getName());
    try {
      try {
        // Test using a midkey that does not exist in the file.
        // First, do a key that is < than first key.  Ensure splits behave
View Full Code Here


    boolean containsStartRow = false;
    for (MapFile.Reader reader: this.r.stores.
        get(Bytes.mapKey(COLUMN_FAMILY_TEXT_MINUS_COLON)).getReaders()) {
      reader.reset();
      HStoreKey key = new HStoreKey();
      ImmutableBytesWritable val = new ImmutableBytesWritable();
      while(reader.next(key, val)) {
        if (Bytes.equals(key.getRow(), STARTROW)) {
          containsStartRow = true;
          count++;
        } else {
View Full Code Here

    int count = 0;
    for (MapFile.Reader reader: this.r.stores.
        get(Bytes.mapKey(COLUMN_FAMILY_TEXT_MINUS_COLON)).getReaders()) {
      reader.reset();
      HStoreKey key = new HStoreKey();
      ImmutableBytesWritable val = new ImmutableBytesWritable();
      while(reader.next(key, val)) {
        count++;
      }
    }
    return count;
View Full Code Here

  /**
   * @param key The key.
   * @return The value.
   */
  public byte[] getValue(byte[] key) {
    return getValue(new ImmutableBytesWritable(key));
  }
View Full Code Here

  public byte[] getValue(byte[] key) {
    return getValue(new ImmutableBytesWritable(key));
  }
 
  private byte[] getValue(final ImmutableBytesWritable key) {
    ImmutableBytesWritable ibw = values.get(key);
    if (ibw == null)
      return null;
    return ibw.get();
  }
View Full Code Here

  /**
   * @param key The key.
   * @param value The value.
   */
  public void setValue(byte[] key, byte[] value) {
    setValue(new ImmutableBytesWritable(key), value);
  }
View Full Code Here

         * Insert data
         */
        for (int j = 0; j < rows[i].length; j++) {
          byte [] row = rows[i][j];
          BatchUpdate b = new BatchUpdate(row);
          b.put(COLUMN_NAME, new ImmutableBytesWritable(row).get());
          regions[i].batchUpdate(b, null);
        }
        HRegion.addRegionToMETA(meta, regions[i]);
      }
      // Close root and meta regions
View Full Code Here

   * @param key The key.
   * @param value The value.
   */
  private void setValue(final ImmutableBytesWritable key,
      final byte[] value) {
    values.put(key, new ImmutableBytesWritable(value));
  }
View Full Code Here

    setRootRegion(in.readBoolean());
    setMetaRegion(in.readBoolean());
    values.clear();
    int numVals = in.readInt();
    for (int i = 0; i < numVals; i++) {
      ImmutableBytesWritable key = new ImmutableBytesWritable();
      ImmutableBytesWritable value = new ImmutableBytesWritable();
      key.readFields(in);
      value.readFields(in);
      values.put(key, value);
    }
    families.clear();
    int numFamilies = in.readInt();
    for (int i = 0; i < numFamilies; i++) {
View Full Code Here

        KeyValue dataKv = new KeyValue(rk, DATA_FAM, chainIdArray,
          Bytes.toBytes(RandomStringUtils.randomAlphabetic(50))
        );

        // Emit the key values.
        context.write(new ImmutableBytesWritable(rk), linkKv);
        context.write(new ImmutableBytesWritable(rk), sortKv);
        context.write(new ImmutableBytesWritable(rk), dataKv);
        // Move to the next row.
        currentRow = nextRow;
        nextRow = Math.abs(rand.nextLong());
      }
    }
View Full Code Here

TOP

Related Classes of org.apache.hadoop.hbase.io.ImmutableBytesWritable

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.