Examples of BlockReader


Examples of org.apache.hadoop.io.file.tfile.BCFile.Reader.BlockReader

     *
     * @throws IOException
     */
    synchronized void checkTFileDataIndex() throws IOException {
      if (tfileIndex == null) {
        BlockReader brIndex = readerBCF.getMetaBlock(TFileIndex.BLOCK_NAME);
        try {
          tfileIndex =
              new TFileIndex(readerBCF.getBlockCount(), brIndex, tfileMeta
                  .getComparator());
        } finally {
          brIndex.close();
        }
      }
    }
View Full Code Here

Examples of org.apache.hadoop.zebra.tfile.BCFile.Reader.BlockReader

    public Reader(FSDataInputStream fsdis, long fileLength, Configuration conf)
        throws IOException {
      readerBCF = new BCFile.Reader(fsdis, fileLength, conf);

      // first, read TFile meta
      BlockReader brMeta = readerBCF.getMetaBlock(TFileMeta.BLOCK_NAME);
      try {
        tfileMeta = new TFileMeta(brMeta);
      } finally {
        brMeta.close();
      }

      comparator = tfileMeta.getComparator();
      // Set begin and end locations.
      begin = new Location(0, 0);
View Full Code Here

Examples of org.apache.hadoop.zebra.tfile.BCFile.Reader.BlockReader

     *
     * @throws IOException
     */
    synchronized void checkTFileDataIndex() throws IOException {
      if (tfileIndex == null) {
        BlockReader brIndex = readerBCF.getMetaBlock(TFileIndex.BLOCK_NAME);
        try {
          tfileIndex =
              new TFileIndex(readerBCF.getBlockCount(), brIndex, tfileMeta
                  .getComparator());
        } finally {
          brIndex.close();
        }
      }
    }
View Full Code Here

Examples of org.apache.hadoop.zebra.tfile.BCFile.Reader.BlockReader

    public Reader(FSDataInputStream fsdis, long fileLength, Configuration conf)
        throws IOException {
      readerBCF = new BCFile.Reader(fsdis, fileLength, conf);

      // first, read TFile meta
      BlockReader brMeta = readerBCF.getMetaBlock(TFileMeta.BLOCK_NAME);
      try {
        tfileMeta = new TFileMeta(brMeta);
      } finally {
        brMeta.close();
      }

      comparator = tfileMeta.getComparator();
      // Set begin and end locations.
      begin = new Location(0, 0);
View Full Code Here

Examples of org.apache.hadoop.zebra.tfile.BCFile.Reader.BlockReader

     *
     * @throws IOException
     */
    synchronized void checkTFileDataIndex() throws IOException {
      if (tfileIndex == null) {
        BlockReader brIndex = readerBCF.getMetaBlock(TFileIndex.BLOCK_NAME);
        try {
          tfileIndex =
              new TFileIndex(readerBCF.getBlockCount(), brIndex, tfileMeta
                  .getComparator());
        } finally {
          brIndex.close();
        }
      }
    }
View Full Code Here

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

            ActivityProcessingException, ActivityTerminatedException
    {
        try
        {
            preprocess();
            BlockReader data = getInput(INPUT_DATA);
            BlockWriter result = getOutput();
            int arraySize = getArraySize();
           
            BytesOutputStream bytes =
                new BytesOutputStream(result, arraySize);

            STypeOutputStream output = new STypeOutputStream(bytes);
            result.write(ControlBlock.LIST_BEGIN);
            Object block;
            while ((block = data.read()) != ControlBlock.NO_MORE_DATA)
            {
                serialise(data, output, block);
            }
            output.close();
            result.write(ControlBlock.LIST_END);
View Full Code Here

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

    }

    private int getArraySize()
        throws DataError, PipeIOException, PipeTerminatedException, InvalidInputValueException
    {
        BlockReader reader = getInput(INPUT_ARRAY_SIZE);
        int arraySize = DEFAULT_ARRAY_SIZE;
        if (reader != null)
        {
            Object block = reader.read();
            if (block instanceof Number)
            {
                int value = ((Number)block).intValue();
                if (value > 0) arraySize = value;
            }
View Full Code Here

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

    public void process() throws ActivityUserException,
            ActivityProcessingException, ActivityTerminatedException
    {
        preprocess();
       
        BlockReader data = getInput(INPUT_DATA);
        BlockWriter result = getOutput(OUTPUT_RESULT);
       
        try
        {
           
            // make sure we have a list of binary data
            // BytesInputStream expects that the LIST_BEGIN has been read
            Object first = data.read();
            if (first != ControlBlock.LIST_BEGIN)
            {
                throw new InvalidInputValueException(INPUT_DATA, first);
            }
           
View Full Code Here

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

    {

       List<ActivityInput> inputs = new ArrayList<ActivityInput>();
        
         // set up block reader for data input
         BlockReader data = getInput(INPUT_DATA);
         if (data == null)
         {
             throw new InvalidActivityInputsException(1, INPUT_DATA);
         }  
         ActivityInput dataInput = new TupleListActivityInput(INPUT_DATA);
         dataInput.setBlockReader(data);
         inputs.add(dataInput);
        
         BlockReader priorities = getInput(INPUT_PRIORITIES);
         if (priorities == null)
         {
             throw new InvalidActivityInputsException(1, INPUT_PRIORITIES);
         }  
         ActivityInput prioritiesInput = new TypedListActivityInput(INPUT_PRIORITIES, Object.class);
View Full Code Here

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

    private BlockReader mKeyIndex;
  protected ActivityInput[] getIterationInputs() {
        List<ActivityInput> inputs = new ArrayList<ActivityInput>();
       
        // set up block reader for items input
        BlockReader items = getInput(INPUT_ITEMS);

        ActivityInput itemsInput = new TupleListActivityInput(INPUT_ITEMS);
        itemsInput.setBlockReader(items);
        inputs.add(itemsInput);
       
        // set up block reader for customers input
        BlockReader customers = getInput(INPUT_TRANSACTIONS);
 
        ActivityInput customersInput = new TupleListActivityInput(INPUT_TRANSACTIONS);
        customersInput.setBlockReader(customers);
        inputs.add(customersInput);
       
       
        // set up block reader for customers input
        BlockReader key = getInput(INPUT_KEY_INDEX);
 
        ActivityInput keyIndexInput = new TypedActivityInput(INPUT_KEY_INDEX, Integer.class);
        keyIndexInput.setBlockReader(key);
        inputs.add(keyIndexInput);
       
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.