Examples of ImmutableBytesWritable


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

  /**
   * Remove a coprocessor from those set on the table
   * @param className Class name of the co-processor
   */
  public void removeCoprocessor(String className) {
    ImmutableBytesWritable match = null;
    Matcher keyMatcher;
    Matcher valueMatcher;
    for (Map.Entry<ImmutableBytesWritable, ImmutableBytesWritable> e : this.values
        .entrySet()) {
      keyMatcher = HConstants.CP_HTD_ATTR_KEY_PATTERN.matcher(Bytes.toString(e
View Full Code Here

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

    @Override
    public Tuple getNext() throws IOException {
        try {
            if (reader.nextKeyValue()) {
                ImmutableBytesWritable rowKey = (ImmutableBytesWritable) reader
                .getCurrentKey();
                Result result = (Result) reader.getCurrentValue();
                int tupleSize=columnList_.size();
                if (loadRowKey_){
                    tupleSize++;
                }
                Tuple tuple=TupleFactory.getInstance().newTuple(tupleSize);

                int startIndex=0;
                if (loadRowKey_){
                    tuple.set(0, new DataByteArray(rowKey.get()));
                    startIndex++;
                }
                for (int i=0;i<columnList_.size();++i){
                    byte[] cell=result.getValue(columnList_.get(i));
                    if (cell!=null)
View Full Code Here

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

    while(val.length() < 1024) {
      val.append(partialValue);
    }
    try {
      value = new ImmutableBytesWritable(
          val.toString().getBytes(HConstants.UTF8_ENCODING));
    } catch (UnsupportedEncodingException e) {
      fail();
    }
    desc = new HTableDescriptor(Bytes.toBytes("test"));
View Full Code Here

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

    HbaseMapWritable<byte [], byte []> mw =
      new HbaseMapWritable<byte [], byte []>();
    mw.put(Bytes.toBytes(splits[1]), Bytes.toBytes(splits[2]));
    byte [] row = Bytes.toBytes(splits[0]);
    r.setStatus("Map emitting " + splits[0] + " for record " + k.toString());
    output.collect(new ImmutableBytesWritable(row), mw);
  }
View Full Code Here

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

    Path p = writeMapFile(getName());
    WritableComparable midkey = getMidkey(p);
    // Now test reading from the top.
    HalfMapFileReader top = new HalfMapFileReader(this.fs, p.toString(),
      this.conf, Reference.Range.top, midkey, null);
    ImmutableBytesWritable val = new ImmutableBytesWritable();
    final String startRowPrefix = "zy";
    HStoreKey key = new HStoreKey(startRowPrefix);
    WritableComparable closest = top.getClosest(key, val);
    assertTrue(closest.toString().startsWith(startRowPrefix));
    int count = 0;
View Full Code Here

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

    try {
      for (char d = FIRST_CHAR; d <= LAST_CHAR; d++) {
        byte[] b = new byte[] {(byte)d};
        byte [] t = Bytes.toBytes(new String(b, HConstants.UTF8_ENCODING));
        writer.append(new HStoreKey(t, t, System.currentTimeMillis()),
            new ImmutableBytesWritable(t));
      }
    } finally {
      writer.close();
    }
    return path;
View Full Code Here

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

      for (char d = FIRST_CHAR; d <= LAST_CHAR; d++) {
        for (char e = FIRST_CHAR; e <= LAST_CHAR; e++) {
          byte[] b = new byte[] { (byte) d, (byte) e };
          byte [] t = Bytes.toBytes(new String(b, HConstants.UTF8_ENCODING));
          writer.append(new HStoreKey(t, t, System.currentTimeMillis()),
            new ImmutableBytesWritable(t));
        }
      }
    } finally {
      writer.close();
    }
View Full Code Here

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

        otherReference.getMidkey().toString());
    // Now confirm that I can read from the reference and that it only gets
    // keys from top half of the file.
    MapFile.Reader halfReader = refHsf.getReader(this.fs, false, false);
    HStoreKey key = new HStoreKey();
    ImmutableBytesWritable value = new ImmutableBytesWritable();
    boolean first = true;
    while(halfReader.next(key, value)) {
      if (first) {
        assertTrue(Bytes.equals(key.getRow(), midkey.getRow()));
        first = false;
View Full Code Here

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

 
  private WritableComparable getMidkey(final Path p) throws IOException {
    MapFile.Reader reader =
      new MapFile.Reader(this.fs, p.toString(), this.conf);
    HStoreKey key = new HStoreKey();
    ImmutableBytesWritable value = new ImmutableBytesWritable();
    reader.next(key, value);
    String firstKey = key.toString();
    WritableComparable midkey = reader.midKey();
    reader.finalKey(key);
    LOG.info("First key " + firstKey + ", midkey " + midkey.toString()
View Full Code Here

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

  private void checkHalfMapFile(final Path p, WritableComparable midkey)
  throws IOException {
    MapFile.Reader top = null;
    MapFile.Reader bottom = null;
    HStoreKey key = new HStoreKey();
    ImmutableBytesWritable value = new ImmutableBytesWritable();
    String previous = null;
    try {
      // Now make two HalfMapFiles and assert they can read the full backing
      // file, one from the top and the other from the bottom.
      // Test bottom half first.
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.