Package co.cask.cdap.internal.io

Examples of co.cask.cdap.internal.io.ByteBufferInputStream.reset()


    return new Function<ByteBuffer, T>() {
      @Nullable
      @Override
      public T apply(ByteBuffer input) {
        byteBufferInput.reset(input);
        try {
          final Schema sourceSchema = schemaCache.get(input);
          Preconditions.checkNotNull(sourceSchema, "Fail to find source schema.");
          return datumReader.read(decoder, sourceSchema);
        } catch (IOException e) {
View Full Code Here


    List<MetricsRecord> records = ImmutableList.copyOf(
      Iterators.filter(Iterators.transform(messages, new Function<FetchedMessage, MetricsRecord>() {
      @Override
      public MetricsRecord apply(FetchedMessage input) {
        try {
          return recordReader.read(new BinaryDecoder(is.reset(input.getPayload())), recordSchema);
        } catch (IOException e) {
          LOG.warn("Failed to decode message to MetricsRecord. Skipped. {}", e.getMessage(), e);
          return null;
        }
      }
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.