Examples of TPut


Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer
        .wrap(valueAname)));
    columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname), ByteBuffer
        .wrap(valueBname)));
    List<TPut> puts = new ArrayList<TPut>();
    puts.add(new TPut(ByteBuffer.wrap(rowName1), columnValues));
    puts.add(new TPut(ByteBuffer.wrap(rowName2), columnValues));

    handler.putMultiple(table, puts);

    List<TDelete> deletes = new ArrayList<TDelete>();
    deletes.add(new TDelete(ByteBuffer.wrap(rowName1)));
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

        ByteBuffer.wrap(valueAname));
    TColumnValue columnValueB = new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname),
        ByteBuffer.wrap(valueBname));
    columnValues.add(columnValueA);
    columnValues.add(columnValueB);
    TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues);

    put.setColumnValues(columnValues);

    handler.put(table, put);

    TDelete delete = new TDelete(ByteBuffer.wrap(rowName));
    List<TColumn> deleteColumns = new ArrayList<TColumn>();
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    List<TColumnValue> columnValues = new ArrayList<TColumnValue>();
    TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname),
        ByteBuffer.wrap(valueAname));
    columnValueA.setTimestamp(System.currentTimeMillis() - 10);
    columnValues.add(columnValueA);
    TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues);

    put.setColumnValues(columnValues);

    handler.put(table, put);
    columnValueA.setTimestamp(System.currentTimeMillis());
    handler.put(table, put);
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    List<TColumnValue> columnValues = new ArrayList<TColumnValue>();
    TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname),
        ByteBuffer.wrap(valueAname));
    columnValueA.setTimestamp(timestamp1);
    columnValues.add(columnValueA);
    TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues);

    put.setColumnValues(columnValues);

    handler.put(table, put);
    columnValueA.setTimestamp(timestamp2);
    handler.put(table, put);
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    ByteBuffer table = ByteBuffer.wrap(tableAname);

    List<TColumnValue> columnValues = new ArrayList<TColumnValue>();
    columnValues.add(new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname), ByteBuffer
        .wrap(Bytes.toBytes(1L))));
    TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues);
    put.setColumnValues(columnValues);
    handler.put(table, put);

    List<TColumnIncrement> incrementColumns = new ArrayList<TColumnIncrement>();
    incrementColumns.add(new TColumnIncrement(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname)));
    TIncrement increment = new TIncrement(ByteBuffer.wrap(rowName), incrementColumns);
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    List<TColumnValue> columnValuesA = new ArrayList<TColumnValue>();
    TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname),
        ByteBuffer.wrap(valueAname));
    columnValuesA.add(columnValueA);
    TPut putA = new TPut(ByteBuffer.wrap(rowName), columnValuesA);
    putA.setColumnValues(columnValuesA);

    List<TColumnValue> columnValuesB = new ArrayList<TColumnValue>();
    TColumnValue columnValueB = new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname),
        ByteBuffer.wrap(valueBname));
    columnValuesB.add(columnValueB);
    TPut putB = new TPut(ByteBuffer.wrap(rowName), columnValuesB);
    putB.setColumnValues(columnValuesB);

    assertFalse(handler.checkAndPut(table, ByteBuffer.wrap(rowName), ByteBuffer.wrap(familyAname),
        ByteBuffer.wrap(qualifierAname), ByteBuffer.wrap(valueAname), putB));

    TGet get = new TGet(ByteBuffer.wrap(rowName));
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    List<TColumnValue> columnValuesA = new ArrayList<TColumnValue>();
    TColumnValue columnValueA = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname),
        ByteBuffer.wrap(valueAname));
    columnValuesA.add(columnValueA);
    TPut putA = new TPut(ByteBuffer.wrap(rowName), columnValuesA);
    putA.setColumnValues(columnValuesA);

    List<TColumnValue> columnValuesB = new ArrayList<TColumnValue>();
    TColumnValue columnValueB = new TColumnValue(ByteBuffer.wrap(familyBname), ByteBuffer.wrap(qualifierBname),
        ByteBuffer.wrap(valueBname));
    columnValuesB.add(columnValueB);
    TPut putB = new TPut(ByteBuffer.wrap(rowName), columnValuesB);
    putB.setColumnValues(columnValuesB);

    // put putB so that we know whether the row has been deleted or not
    handler.put(table, putB);

    TDelete delete = new TDelete(ByteBuffer.wrap(rowName));
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    TColumnValue columnValue = new TColumnValue(ByteBuffer.wrap(familyAname), ByteBuffer.wrap(qualifierAname),
        ByteBuffer.wrap(valueAname));
    List<TColumnValue> columnValues = new ArrayList<TColumnValue>();
    columnValues.add(columnValue);
    for (int i = 0; i < 10; i++) {
      TPut put = new TPut(ByteBuffer.wrap(("testScan" + i).getBytes()), columnValues);
      handler.put(table, put);
    }

    int scanId = handler.openScanner(table, scan);
    List<TResult> results = handler.getScannerRows(scanId, 10);
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

                                      ByteBuffer.wrap(qualifierAname),
                                      ByteBuffer.wrap(valueAname)));
    columnValues.add(new TColumnValue(ByteBuffer.wrap(familyBname),
                                      ByteBuffer.wrap(qualifierBname),
                                      ByteBuffer.wrap(valueBname)));
    TPut put = new TPut(ByteBuffer.wrap(rowName), columnValues);
    put.setColumnValues(columnValues);

    handler.put(table, put);

    assertTrue(handler.exists(table, get));
    metricsHelper.assertCounter("put_num_ops", 1, metrics.getSource());
View Full Code Here

Examples of org.apache.hadoop.hbase.thrift2.generated.TPut

    // open the transport
    transport.open();
   
    ByteBuffer table = ByteBuffer.wrap("example".getBytes());

    TPut put = new TPut();
    put.setRow("row1".getBytes());

    TColumnValue columnValue = new TColumnValue();
    columnValue.setFamily("family1".getBytes());
    columnValue.setQualifier("qualifier1".getBytes());
    columnValue.setValue("value1".getBytes());
    List<TColumnValue> columnValues = new ArrayList<TColumnValue>();
    columnValues.add(columnValue);
    put.setColumnValues(columnValues);

    client.put(table, put);

    TGet get = new TGet();
    get.setRow("row1".getBytes());
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.