Search in sources :

Example 1 with HadoopIgfsInputStream

use of org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsInputStream in project ignite by apache.

the class IgniteHadoopFileSystem method open.

/**
 * {@inheritDoc}
 */
@Override
public FSDataInputStream open(Path f, int bufSize) throws IOException {
    A.notNull(f, "f");
    enterBusy();
    try {
        IgfsPath path = convert(f);
        HadoopIgfsStreamDelegate stream = seqReadsBeforePrefetchOverride ? rmtClient.open(path, seqReadsBeforePrefetch) : rmtClient.open(path);
        long logId = -1;
        if (clientLog.isLogEnabled()) {
            logId = IgfsLogger.nextId();
            clientLog.logOpen(logId, path, bufSize, stream.length());
        }
        if (LOG.isDebugEnabled())
            LOG.debug("Opening input stream [thread=" + Thread.currentThread().getName() + ", path=" + path + ", bufSize=" + bufSize + ']');
        HadoopIgfsInputStream igfsIn = new HadoopIgfsInputStream(stream, stream.length(), bufSize, LOG, clientLog, logId);
        if (LOG.isDebugEnabled())
            LOG.debug("Opened input stream [path=" + path + ", delegate=" + stream + ']');
        return new FSDataInputStream(igfsIn);
    } finally {
        leaveBusy();
    }
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath) HadoopIgfsInputStream(org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsInputStream) HadoopIgfsStreamDelegate(org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsStreamDelegate) FSDataInputStream(org.apache.hadoop.fs.FSDataInputStream)

Example 2 with HadoopIgfsInputStream

use of org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsInputStream in project ignite by apache.

the class IgniteHadoopFileSystem method open.

/**
 * {@inheritDoc}
 */
@Override
public FSDataInputStream open(Path f, int bufSize) throws IOException {
    A.notNull(f, "f");
    enterBusy();
    try {
        IgfsPath path = convert(f);
        HadoopIgfsStreamDelegate stream = seqReadsBeforePrefetchOverride ? rmtClient.open(path, seqReadsBeforePrefetch) : rmtClient.open(path);
        long logId = -1;
        if (clientLog.isLogEnabled()) {
            logId = IgfsLogger.nextId();
            clientLog.logOpen(logId, path, bufSize, stream.length());
        }
        if (LOG.isDebugEnabled())
            LOG.debug("Opening input stream [thread=" + Thread.currentThread().getName() + ", path=" + path + ", bufSize=" + bufSize + ']');
        HadoopIgfsInputStream igfsIn = new HadoopIgfsInputStream(stream, stream.length(), bufSize, LOG, clientLog, logId);
        if (LOG.isDebugEnabled())
            LOG.debug("Opened input stream [path=" + path + ", delegate=" + stream + ']');
        return new FSDataInputStream(igfsIn);
    } finally {
        leaveBusy();
    }
}
Also used : IgfsPath(org.apache.ignite.igfs.IgfsPath) HadoopIgfsInputStream(org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsInputStream) HadoopIgfsStreamDelegate(org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsStreamDelegate) FSDataInputStream(org.apache.hadoop.fs.FSDataInputStream)

Aggregations

FSDataInputStream (org.apache.hadoop.fs.FSDataInputStream)2 IgfsPath (org.apache.ignite.igfs.IgfsPath)2 HadoopIgfsInputStream (org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsInputStream)2 HadoopIgfsStreamDelegate (org.apache.ignite.internal.processors.hadoop.impl.igfs.HadoopIgfsStreamDelegate)2