Examples of readTuple()


Examples of cascading.tuple.hadoop.io.HadoopTupleInputStream.readTuple()

    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( byteArrayOutputStream.toByteArray() );
    TupleInputStream dataInputStream = new HadoopTupleInputStream( byteArrayInputStream, new TupleSerialization().getElementReader() );

    Tuple newTuple = new Tuple();

    dataInputStream.readTuple( newTuple );

    assertEquals( aTuple, newTuple );
    }

  @Test
View Full Code Here

Examples of cascading.tuple.hadoop.io.HadoopTupleInputStream.readTuple()

    TupleInputStream input = new HadoopTupleInputStream( new FileInputStream( file ), tupleSerialization.getElementReader() );

    int k = -1;
    for( int i = 0; i < 501; i++ )
      {
      Tuple tuple = input.readTuple();
      int value = tuple.getInteger( 0 );
      assertTrue( "wrong diff", value - k == 1 );
      assertTrue( "wrong type", tuple.getObject( 3 ) instanceof TestText );
      assertTrue( "wrong type", tuple.getObject( 4 ) instanceof Tuple );
      assertTrue( "wrong type", tuple.getObject( 5 ) instanceof BytesWritable );
View Full Code Here

Examples of cascading.tuple.io.TupleInputStream.readTuple()

    ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream( byteArrayOutputStream.toByteArray() );
    TupleInputStream dataInputStream = new HadoopTupleInputStream( byteArrayInputStream, new TupleSerialization().getElementReader() );

    Tuple newTuple = new Tuple();

    dataInputStream.readTuple( newTuple );

    assertEquals( aTuple, newTuple );
    }

  @Test
View Full Code Here

Examples of cascading.tuple.io.TupleInputStream.readTuple()

    TupleInputStream input = new HadoopTupleInputStream( new FileInputStream( file ), tupleSerialization.getElementReader() );

    int k = -1;
    for( int i = 0; i < 501; i++ )
      {
      Tuple tuple = input.readTuple();
      int value = tuple.getInteger( 0 );
      assertTrue( "wrong diff", value - k == 1 );
      assertTrue( "wrong type", tuple.getObject( 3 ) instanceof TestText );
      assertTrue( "wrong type", tuple.getObject( 4 ) instanceof Tuple );
      assertTrue( "wrong type", tuple.getObject( 5 ) instanceof BytesWritable );
View Full Code Here

Examples of com.mysql.ndbjtie.ndbapi.NdbIndexOperation.readTuple()

        IndexConst ndbIndex = ndbDictionary.getIndex(storeIndex.getInternalName(), storeTable.getName());
        handleError(ndbIndex, ndbDictionary);
        NdbIndexOperation ndbIndexOperation = ndbTransaction.getNdbIndexOperation(ndbIndex);
        handleError(ndbIndexOperation, ndbTransaction);
        int lockMode = lookupLockMode;
        int returnCode = ndbIndexOperation.readTuple(lockMode);
        handleError(returnCode, ndbTransaction);
        if (logger.isTraceEnabled()) logger.trace("Table: " + storeTable.getName() + " index: " + storeIndex.getName());
        return new IndexOperationImpl(storeTable, ndbIndexOperation, this);
    }
View Full Code Here

Examples of com.mysql.ndbjtie.ndbapi.NdbOperation.readTuple()

    protected void ndbjtieLookup(int c0) {
        // get a lookup operation for the table
        NdbOperation op = tx.getNdbOperation(table_t0);
        if (op == null)
            throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));
        if (op.readTuple(ndbOpLockMode) != 0)
            throw new RuntimeException(TwsUtils.toStr(tx.getNdbError()));

        int p = bb.position();

        // include exception handling as part of transcoding pattern
View Full Code Here

Examples of com.mysql.ndbjtie.ndbapi.NdbOperation.readTuple()

        for (int i = 0, j = from; i < count; i++, j++) {
            // get a read operation for the table
            NdbOperation op = tx.getNdbOperation(table);
            if (op == null)
                throw new RuntimeException(toStr(tx.getNdbError()));
            if (op.readTuple(NdbOperation.LockMode.LM_CommittedRead) != 0)
                throw new RuntimeException(toStr(tx.getNdbError()));

            // set key attribute
            if (op.equal(model.attr_id, j) != 0)
                throw new RuntimeException(toStr(tx.getNdbError()));
View Full Code Here

Examples of com.mysql.ndbjtie.ndbapi.NdbOperation.readTuple()

        for (int i = 0, j = from; i < count; i++, j++) {
            // get a read operation for the table
            NdbOperation op = tx.getNdbOperation(table);
            if (op == null)
                throw new RuntimeException(toStr(tx.getNdbError()));
            if (op.readTuple(NdbOperation.LockMode.LM_CommittedRead) != 0)
                throw new RuntimeException(toStr(tx.getNdbError()));

            // set key attribute
            if (op.equal(model.attr_id, j) != 0)
                throw new RuntimeException(toStr(tx.getNdbError()));
View Full Code Here

Examples of com.mysql.ndbjtie.ndbapi.NdbOperation.readTuple()

        TableConst ndbTable = ndbDictionary.getTable(storeTable.getName());
        handleError(ndbTable, ndbDictionary);
        NdbOperation ndbOperation = ndbTransaction.getNdbOperation(ndbTable);
        handleError(ndbOperation, ndbTransaction);
        int lockMode = findLockMode;
        int returnCode = ndbOperation.readTuple(lockMode);
        handleError(returnCode, ndbTransaction);
        if (logger.isTraceEnabled()) logger.trace("Table: " + storeTable.getName());
        return new OperationImpl(storeTable, ndbOperation, this);
    }
View Full Code Here

Examples of uk.org.ogsadai.tuple.serialise.TupleInputStream.readTuple()

        {
            TupleInputStream tuples = new TupleInputStream(input);
            writer.write(new MetadataWrapper(tuples.readTupleMetadata()));
            while (true)
            {
                Tuple tuple = tuples.readTuple();
                writer.write(tuple);
            }
        }
        catch (EOFException e)
        {
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.