Package com.netflix.aegisthus.input

Examples of com.netflix.aegisthus.input.AegSplit


    }
  }

  @Override
  public void initialize(InputSplit inputSplit, TaskAttemptContext ctx) throws IOException, InterruptedException {
    AegSplit split = (AegSplit) inputSplit;
    InputStream is = split.getInput(ctx.getConfiguration());
    start = split.getStart();
    end = split.getEnd();
    pos = start;
    is.skip(split.getStart());
    if (split.getPath().getName().endsWith(".gz")) {
      reader = new BufferedReader(new InputStreamReader(new GZIPInputStream(is)));
    } else {
      reader = new BufferedReader(new InputStreamReader(is));
    }
  }
View Full Code Here


        }
    }

    @Override
    public void initialize(InputSplit inputSplit, TaskAttemptContext ctx) throws IOException, InterruptedException {
        AegSplit split = (AegSplit) inputSplit;

        start = split.getStart();
        end = split.getEnd();
        final Path file = split.getPath();

        try {
            cfId = ctx.getConfiguration().getInt("commitlog.cfid", -1000);
            if (cfId == -1000) {
                throw new IOException("commitlog.cfid must be set");
            }
            // open the file and seek to the start of the split
            FileSystem fs = file.getFileSystem(ctx.getConfiguration());
            FSDataInputStream fileIn = fs.open(split.getPath());
            InputStream dis = new BufferedInputStream(fileIn);
            scanner = new CommitLogScanner(new DataInputStream(dis), split.getConvertors(),
                    Descriptor.fromFilename(split.getPath().getName()).version);
            this.pos = start;
        } catch (IOException e) {
            throw new IOError(e);
        }
    }
View Full Code Here

  }

  @SuppressWarnings("rawtypes")
  @Override
  public void initialize(InputSplit inputSplit, TaskAttemptContext ctx) throws IOException, InterruptedException {
    AegSplit split = (AegSplit) inputSplit;

    start = split.getStart();
    //TODO: This has a side effect of setting compressionmetadata. remove this.
    InputStream is = split.getInput(ctx.getConfiguration());
    if (split.isCompressed()) {
      end = split.getCompressionMetadata().getDataLength();
    } else {
      end = split.getEnd();
    }
    outputFile = ctx.getConfiguration().getBoolean("aegsithus.debug.file", false);
    filename = split.getPath().toUri().toString();

    LOG.info(String.format("File: %s", split.getPath().toUri().getPath()));
    LOG.info("Start: " + start);
    LOG.info("End: " + end);
    if (ctx instanceof TaskInputOutputContext) {
      context = (TaskInputOutputContext) ctx;
    }

    try {
      scanner = new SSTableScanner(new DataInputStream(is),
          split.getConvertors(), end, Descriptor.fromFilename(filename).version);
      if (ctx.getConfiguration().get("aegisthus.maxcolsize") != null) {
        scanner.setMaxColSize(ctx.getConfiguration().getLong("aegisthus.maxcolsize", -1L));
        LOG.info(String.format("aegisthus.maxcolsize - %d",
            ctx.getConfiguration().getLong("aegisthus.maxcolsize", -1L)));
      }
View Full Code Here

TOP

Related Classes of com.netflix.aegisthus.input.AegSplit

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.