Examples of writeTuple()


Examples of cascading.tuple.hadoop.io.HadoopTupleOutputStream.writeTuple()

    Tuple aTuple = new Tuple( new TestWritableComparable( "Just My Luck" ), "ClaudiaPuig", "3.0", "LisaRose", "3.0", true );

    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    TupleOutputStream dataOutputStream = new HadoopTupleOutputStream( byteArrayOutputStream, new TupleSerialization().getElementWriter() );

    dataOutputStream.writeTuple( aTuple );

    dataOutputStream.flush();

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

Examples of cascading.tuple.hadoop.io.HadoopTupleOutputStream.writeTuple()

    for( int i = 0; i < 501; i++ ) // 501 is arbitrary
      {
      String aString = "string number " + i;
      double random = Math.random();

      output.writeTuple( new Tuple( i, aString, random, new TestText( aString ), new Tuple( "inner tuple", new BytesWritable( "some string".getBytes() ) ), new BytesWritable( Integer.toString( i ).getBytes( "UTF-8" ) ), new BooleanWritable( false ) ) );
      }

    output.close();

    assertEquals( "wrong size", 89967L, file.length() ); // just makes sure the file size doesnt change from expected
View Full Code Here

Examples of cascading.tuple.io.TupleOutputStream.writeTuple()

    Tuple aTuple = new Tuple( new TestWritableComparable( "Just My Luck" ), "ClaudiaPuig", "3.0", "LisaRose", "3.0", true );

    ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
    TupleOutputStream dataOutputStream = new HadoopTupleOutputStream( byteArrayOutputStream, new TupleSerialization().getElementWriter() );

    dataOutputStream.writeTuple( aTuple );

    dataOutputStream.flush();

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

Examples of cascading.tuple.io.TupleOutputStream.writeTuple()

    for( int i = 0; i < 501; i++ ) // 501 is arbitrary
      {
      String aString = "string number " + i;
      double random = Math.random();

      output.writeTuple( new Tuple( i, aString, random, new TestText( aString ), new Tuple( "inner tuple", new BytesWritable( "some string".getBytes() ) ), new BytesWritable( Integer.toString( i ).getBytes( "UTF-8" ) ), new BooleanWritable( false ) ) );
      }

    output.close();

    assertEquals( "wrong size", 89967L, file.length() ); // just makes sure the file size doesnt change from expected
View Full Code Here

Examples of com.hmsonline.storm.cassandra.client.AstyanaxClient.writeTuple()

        Fields fields = new Fields("key1", "key2", "foo", "bar");
        Values values = new Values("key1val", "key2val", "fooval", "barval");
        Tuple tuple = new MockTuple(fields, values);

        client.writeTuple(tuple, tupleMapper);

        AstyanaxContext<Keyspace> context = newContext("localhost:9160", KEYSPACE);
        Keyspace ks = context.getEntity();

        Column<String> result = ks
View Full Code Here

Examples of com.hmsonline.storm.cassandra.client.AstyanaxClient.writeTuple()

        Values values = new Values("key1val", "key2val", "fooval", "barval");
        TridentTuple tuple = newTridentTuple(fields, values);
       
        SimpleTridentTupleMapper tupleMapper = new SimpleTridentTupleMapper(KEYSPACE, fields);
       
        client.writeTuple(tuple, tupleMapper);
       
        Map<String, String> map = client.lookup(tupleMapper, tuple);
       
        assertEquals("fooval", map.get("foo"));
       
View Full Code Here

Examples of com.hmsonline.storm.cassandra.client.AstyanaxClient.writeTuple()

        Values values = new Values("my_row", "a", "a", "aa");
        TridentTuple tuple = newTridentTuple(fields, values);
       
        CompositeColumnTridentTupleMapper tupleMapper = new CompositeColumnTridentTupleMapper(KEYSPACE);
       
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "b", "b", "bb"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "b", "ab"));
View Full Code Here

Examples of com.hmsonline.storm.cassandra.client.AstyanaxClient.writeTuple()

        CompositeColumnTridentTupleMapper tupleMapper = new CompositeColumnTridentTupleMapper(KEYSPACE);
       
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "b", "b", "bb"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "b", "ab"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "c", "ac"));
View Full Code Here

Examples of com.hmsonline.storm.cassandra.client.AstyanaxClient.writeTuple()

       
        tuple = newTridentTuple(fields, new Values("my_row", "b", "b", "bb"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "b", "ab"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "c", "ac"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "d", "ad"));
View Full Code Here

Examples of com.hmsonline.storm.cassandra.client.AstyanaxClient.writeTuple()

       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "b", "ab"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "c", "ac"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "a", "d", "ad"));
        client.writeTuple(tuple, tupleMapper);
       
        tuple = newTridentTuple(fields, new Values("my_row", "c", "c", "cc"));
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.