Package uk.org.ogsadai.activity.io

Examples of uk.org.ogsadai.activity.io.BlockWriter


        ActivityUserException
    {
        final int numberTuples = (Integer) iterationData[0];
        final String tuples = (String) iterationData[1];
       
        BlockWriter output = getOutput();
                try {
          List data = new ArrayList();
                  StringTokenizer tokenizer = new StringTokenizer(tuples,",");
                  while(tokenizer.hasMoreTokens())
              {
                data.add(tokenizer.nextToken());
              }

          ColumnMetadata columnMetaData = new SimpleColumnMetadata("BOGUS_COLUMN_NAME", 1, 1, 1, 1);
          List listColumnMetadata = new ArrayList();
          for (int i=0; i<data.size(); i++)
          {
            listColumnMetadata.add(columnMetaData);
          }
         
          output.write(ControlBlock.LIST_BEGIN);
         
          output.write(new MetadataWrapper(new SimpleTupleMetadata(listColumnMetadata)));

          for(int i=0;i<numberTuples;i++){
                    // Create the tuple tuple consisting of the above data
                    // and the metadata.
                    Tuple tuple = new SimpleTuple(data);
                    output.write(tuple);
          }
          output.write(ControlBlock.LIST_END);
         
        } catch (PipeClosedException e) {
          // TODO Auto-generated catch block
          e.printStackTrace();
        } catch (PipeIOException e) {
View Full Code Here

TOP

Related Classes of uk.org.ogsadai.activity.io.BlockWriter

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.