Giter Site home page Giter Site logo

Comments (6)

mricken avatar mricken commented on June 2, 2024 1

Thank you for your fix, we'll work on making a new release that includes your contribution.

from oci-hdfs-connector.

kvirund avatar kvirund commented on June 2, 2024

The problem is with read implementations of the com.oracle.bmc.hdfs.store.BmcReadAheadFSInputStream: they do not call the super.read and do not change statistics on their own.

from oci-hdfs-connector.

kvirund avatar kvirund commented on June 2, 2024

Implementations should be changed to:

    @Override
    public int read() throws IOException {
        LOG.debug("{}: Reading single byte at position {}", this, filePos);
        if (dataPos == -1) {
            fillBuffer();
        }
        if (dataPos == -1) {
            return -1;
        }
        filePos++;
        int result = Byte.toUnsignedInt(data[dataCurOffset++]);
+       this.statistics.incrementBytesRead(1);
        if (atEndOfBuffer()) {
            clearBuffer();
        }
        return result;
    }

and

    @Override
    public int read(byte[] buffer, int offset, int length) throws IOException {
        LOG.debug("{}: Reading {} bytes at current position {}", this, length, filePos);
        if (dataPos == -1) {
            fillBuffer();
        }
        if (dataPos == -1) {
            return -1; // EOF
        }
        int n = Math.min(length, dataMax - dataCurOffset);
        System.arraycopy(data, dataCurOffset, buffer, offset, n);
        dataCurOffset += n;
        filePos += n;
        if (atEndOfBuffer()) {
            if (n != length) {
                LOG.debug("{}: Short Read; exhausted buffer", this);
            }
            clearBuffer();
        }
+       this.statistics.incrementBytesRead(n);
        return n;
    }

from oci-hdfs-connector.

kvirund avatar kvirund commented on June 2, 2024

Tested it by referencing patched implementation in fs.oci.io.read.custom.stream.

from oci-hdfs-connector.

anton-gorev-oracle avatar anton-gorev-oracle commented on June 2, 2024

PR: #78

from oci-hdfs-connector.

mricken avatar mricken commented on June 2, 2024

This was released in version 3.3.4.0.0.0. Closing.

from oci-hdfs-connector.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.