Skip to content

Commit 97419fa

Browse files
committed
Fix
1 parent 1098eb4 commit 97419fa

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/Storages/ObjectStorage/HDFS/ReadBufferFromHDFS.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ namespace ErrorCodes
2929
extern const int SEEK_POSITION_OUT_OF_BOUND;
3030
extern const int LOGICAL_ERROR;
3131
extern const int UNKNOWN_FILE_SIZE;
32+
extern const int HDFS_ERROR;
3233
}
3334

3435

@@ -175,9 +176,9 @@ struct ReadBufferFromHDFS::ReadBufferFromHDFSImpl : public BufferWithOwnMemory<S
175176

176177
size_t pread(char * buffer, size_t size, size_t offset)
177178
{
178-
ResourceGuard rlock(ResourceGuard::Metrics::getIORead(), read_settings.io_scheduling.read_resource_link, size);
179+
ResourceGuard rlock(read_settings.resource_link, size);
179180
auto bytes_read = wrapErr<tSize>(hdfsPread, fs.get(), fin, buffer, safe_cast<int>(size), offset);
180-
rlock.unlock(std::max(0, bytes_read));
181+
rlock.unlock();
181182

182183
if (bytes_read < 0)
183184
{

src/Storages/ObjectStorage/HDFS/WriteBufferFromHDFS.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ struct WriteBufferFromHDFS::WriteBufferFromHDFSImpl : public HDFSErrorWrapper
4242
int flags)
4343
: HDFSErrorWrapper(hdfs_uri_, config_)
4444
, hdfs_uri(hdfs_uri_)
45-
, builder(createHDFSBuilder(hdfs_uri, config_))
4645
, fs(createHDFSFS(builder.get()))
4746
, write_settings(write_settings_)
4847
{

0 commit comments

Comments
 (0)