You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2017/03/17 00:47:32 UTC
arrow git commit: ARROW-593 [C++]: Rename ReadableFileInterface to
RandomAccessFile
Repository: arrow
Updated Branches:
refs/heads/master 867f92470 -> 3ee3822b6
ARROW-593 [C++]: Rename ReadableFileInterface to RandomAccessFile
Author: Johan Mabille <jo...@gmail.com>
Closes #393 from JohanMabille/raf and squashes the following commits:
ba755a6 [Johan Mabille] type alias for backward compatibility
c9e459f [Johan Mabille] Renamed ReadableFileInterface to RandomAccessFile
Project: http://git-wip-us.apache.org/repos/asf/arrow/repo
Commit: http://git-wip-us.apache.org/repos/asf/arrow/commit/3ee3822b
Tree: http://git-wip-us.apache.org/repos/asf/arrow/tree/3ee3822b
Diff: http://git-wip-us.apache.org/repos/asf/arrow/diff/3ee3822b
Branch: refs/heads/master
Commit: 3ee3822b6dccc9c859e5a324ef01fc1e9bf75dd1
Parents: 867f924
Author: Johan Mabille <jo...@gmail.com>
Authored: Thu Mar 16 20:47:09 2017 -0400
Committer: Wes McKinney <we...@twosigma.com>
Committed: Thu Mar 16 20:47:09 2017 -0400
----------------------------------------------------------------------
cpp/src/arrow/io/file.h | 4 ++--
cpp/src/arrow/io/hdfs.h | 2 +-
cpp/src/arrow/io/interfaces.cc | 6 +++---
cpp/src/arrow/io/interfaces.h | 10 ++++++----
cpp/src/arrow/io/memory.h | 2 +-
cpp/src/arrow/ipc/adapter.cc | 14 +++++++-------
cpp/src/arrow/ipc/adapter.h | 8 ++++----
cpp/src/arrow/ipc/feather.cc | 6 +++---
cpp/src/arrow/ipc/feather.h | 4 ++--
cpp/src/arrow/ipc/ipc-adapter-test.cc | 2 +-
cpp/src/arrow/ipc/json.h | 2 +-
cpp/src/arrow/ipc/metadata.cc | 2 +-
cpp/src/arrow/ipc/metadata.h | 4 ++--
cpp/src/arrow/ipc/reader.cc | 8 ++++----
cpp/src/arrow/ipc/reader.h | 6 +++---
python/pyarrow/_feather.pyx | 4 ++--
python/pyarrow/_parquet.pxd | 6 +++---
python/pyarrow/_parquet.pyx | 4 ++--
python/pyarrow/includes/libarrow_io.pxd | 10 +++++-----
python/pyarrow/includes/libarrow_ipc.pxd | 6 +++---
python/pyarrow/includes/pyarrow.pxd | 2 +-
python/pyarrow/io.pxd | 8 ++++----
python/pyarrow/io.pyx | 16 ++++++++--------
python/src/pyarrow/io.h | 2 +-
24 files changed, 70 insertions(+), 68 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/io/file.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/file.h b/cpp/src/arrow/io/file.h
index fe55e96..f687fad 100644
--- a/cpp/src/arrow/io/file.h
+++ b/cpp/src/arrow/io/file.h
@@ -64,7 +64,7 @@ class ARROW_EXPORT FileOutputStream : public OutputStream {
};
// Operating system file
-class ARROW_EXPORT ReadableFile : public ReadableFileInterface {
+class ARROW_EXPORT ReadableFile : public RandomAccessFile {
public:
~ReadableFile();
@@ -115,7 +115,7 @@ class ARROW_EXPORT MemoryMappedFile : public ReadWriteFileInterface {
Status Seek(int64_t position) override;
- // Required by ReadableFileInterface, copies memory into out. Not thread-safe
+ // Required by RandomAccessFile, copies memory into out. Not thread-safe
Status Read(int64_t nbytes, int64_t* bytes_read, uint8_t* out) override;
// Zero copy read. Not thread-safe
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/io/hdfs.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/hdfs.h b/cpp/src/arrow/io/hdfs.h
index fbf1d75..e3f5442 100644
--- a/cpp/src/arrow/io/hdfs.h
+++ b/cpp/src/arrow/io/hdfs.h
@@ -159,7 +159,7 @@ class ARROW_EXPORT HdfsClient : public FileSystemClient {
DISALLOW_COPY_AND_ASSIGN(HdfsClient);
};
-class ARROW_EXPORT HdfsReadableFile : public ReadableFileInterface {
+class ARROW_EXPORT HdfsReadableFile : public RandomAccessFile {
public:
~HdfsReadableFile();
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/io/interfaces.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/interfaces.cc b/cpp/src/arrow/io/interfaces.cc
index 51ed069..06957d4 100644
--- a/cpp/src/arrow/io/interfaces.cc
+++ b/cpp/src/arrow/io/interfaces.cc
@@ -29,18 +29,18 @@ namespace io {
FileInterface::~FileInterface() {}
-ReadableFileInterface::ReadableFileInterface() {
+RandomAccessFile::RandomAccessFile() {
set_mode(FileMode::READ);
}
-Status ReadableFileInterface::ReadAt(
+Status RandomAccessFile::ReadAt(
int64_t position, int64_t nbytes, int64_t* bytes_read, uint8_t* out) {
std::lock_guard<std::mutex> guard(lock_);
RETURN_NOT_OK(Seek(position));
return Read(nbytes, bytes_read, out);
}
-Status ReadableFileInterface::ReadAt(
+Status RandomAccessFile::ReadAt(
int64_t position, int64_t nbytes, std::shared_ptr<Buffer>* out) {
std::lock_guard<std::mutex> guard(lock_);
RETURN_NOT_OK(Seek(position));
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/io/interfaces.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/interfaces.h b/cpp/src/arrow/io/interfaces.h
index 9862a67..258a315 100644
--- a/cpp/src/arrow/io/interfaces.h
+++ b/cpp/src/arrow/io/interfaces.h
@@ -97,7 +97,7 @@ class ARROW_EXPORT InputStream : virtual public FileInterface, public Readable {
InputStream() {}
};
-class ARROW_EXPORT ReadableFileInterface : public InputStream, public Seekable {
+class ARROW_EXPORT RandomAccessFile : public InputStream, public Seekable {
public:
virtual Status GetSize(int64_t* size) = 0;
@@ -118,7 +118,7 @@ class ARROW_EXPORT ReadableFileInterface : public InputStream, public Seekable {
protected:
std::mutex lock_;
- ReadableFileInterface();
+ RandomAccessFile();
};
class ARROW_EXPORT WriteableFileInterface : public OutputStream, public Seekable {
@@ -129,12 +129,14 @@ class ARROW_EXPORT WriteableFileInterface : public OutputStream, public Seekable
WriteableFileInterface() { set_mode(FileMode::READ); }
};
-class ARROW_EXPORT ReadWriteFileInterface : public ReadableFileInterface,
+class ARROW_EXPORT ReadWriteFileInterface : public RandomAccessFile,
public WriteableFileInterface {
protected:
- ReadWriteFileInterface() { ReadableFileInterface::set_mode(FileMode::READWRITE); }
+ ReadWriteFileInterface() { RandomAccessFile::set_mode(FileMode::READWRITE); }
};
+using ReadableFileInterface = RandomAccessFile;
+
} // namespace io
} // namespace arrow
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/io/memory.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/io/memory.h b/cpp/src/arrow/io/memory.h
index 8280750..eb2a509 100644
--- a/cpp/src/arrow/io/memory.h
+++ b/cpp/src/arrow/io/memory.h
@@ -66,7 +66,7 @@ class ARROW_EXPORT BufferOutputStream : public OutputStream {
uint8_t* mutable_data_;
};
-class ARROW_EXPORT BufferReader : public ReadableFileInterface {
+class ARROW_EXPORT BufferReader : public RandomAccessFile {
public:
explicit BufferReader(const std::shared_ptr<Buffer>& buffer);
BufferReader(const uint8_t* data, int64_t size);
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/adapter.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/adapter.cc b/cpp/src/arrow/ipc/adapter.cc
index 406ce24..db9f63c 100644
--- a/cpp/src/arrow/ipc/adapter.cc
+++ b/cpp/src/arrow/ipc/adapter.cc
@@ -523,7 +523,7 @@ Status GetRecordBatchSize(const RecordBatch& batch, int64_t* size) {
class IpcComponentSource : public ArrayComponentSource {
public:
- IpcComponentSource(const RecordBatchMetadata& metadata, io::ReadableFileInterface* file)
+ IpcComponentSource(const RecordBatchMetadata& metadata, io::RandomAccessFile* file)
: metadata_(metadata), file_(file) {}
Status GetBuffer(int buffer_index, std::shared_ptr<Buffer>* out) override {
@@ -547,14 +547,14 @@ class IpcComponentSource : public ArrayComponentSource {
private:
const RecordBatchMetadata& metadata_;
- io::ReadableFileInterface* file_;
+ io::RandomAccessFile* file_;
};
class RecordBatchReader {
public:
RecordBatchReader(const RecordBatchMetadata& metadata,
const std::shared_ptr<Schema>& schema, int max_recursion_depth,
- io::ReadableFileInterface* file)
+ io::RandomAccessFile* file)
: metadata_(metadata),
schema_(schema),
max_recursion_depth_(max_recursion_depth),
@@ -582,24 +582,24 @@ class RecordBatchReader {
const RecordBatchMetadata& metadata_;
std::shared_ptr<Schema> schema_;
int max_recursion_depth_;
- io::ReadableFileInterface* file_;
+ io::RandomAccessFile* file_;
};
Status ReadRecordBatch(const RecordBatchMetadata& metadata,
- const std::shared_ptr<Schema>& schema, io::ReadableFileInterface* file,
+ const std::shared_ptr<Schema>& schema, io::RandomAccessFile* file,
std::shared_ptr<RecordBatch>* out) {
return ReadRecordBatch(metadata, schema, kMaxNestingDepth, file, out);
}
Status ReadRecordBatch(const RecordBatchMetadata& metadata,
const std::shared_ptr<Schema>& schema, int max_recursion_depth,
- io::ReadableFileInterface* file, std::shared_ptr<RecordBatch>* out) {
+ io::RandomAccessFile* file, std::shared_ptr<RecordBatch>* out) {
RecordBatchReader reader(metadata, schema, max_recursion_depth, file);
return reader.Read(out);
}
Status ReadDictionary(const DictionaryBatchMetadata& metadata,
- const DictionaryTypeMap& dictionary_types, io::ReadableFileInterface* file,
+ const DictionaryTypeMap& dictionary_types, io::RandomAccessFile* file,
std::shared_ptr<Array>* out) {
int64_t id = metadata.id();
auto it = dictionary_types.find(id);
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/adapter.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/adapter.h b/cpp/src/arrow/ipc/adapter.h
index 21d814d..cea4686 100644
--- a/cpp/src/arrow/ipc/adapter.h
+++ b/cpp/src/arrow/ipc/adapter.h
@@ -39,7 +39,7 @@ class Status;
namespace io {
-class ReadableFileInterface;
+class RandomAccessFile;
class OutputStream;
} // namespace io
@@ -87,15 +87,15 @@ Status GetRecordBatchSize(const RecordBatch& batch, int64_t* size);
// "Read" path; does not copy data if the input supports zero copy reads
Status ReadRecordBatch(const RecordBatchMetadata& metadata,
- const std::shared_ptr<Schema>& schema, io::ReadableFileInterface* file,
+ const std::shared_ptr<Schema>& schema, io::RandomAccessFile* file,
std::shared_ptr<RecordBatch>* out);
Status ReadRecordBatch(const RecordBatchMetadata& metadata,
const std::shared_ptr<Schema>& schema, int max_recursion_depth,
- io::ReadableFileInterface* file, std::shared_ptr<RecordBatch>* out);
+ io::RandomAccessFile* file, std::shared_ptr<RecordBatch>* out);
Status ReadDictionary(const DictionaryBatchMetadata& metadata,
- const DictionaryTypeMap& dictionary_types, io::ReadableFileInterface* file,
+ const DictionaryTypeMap& dictionary_types, io::RandomAccessFile* file,
std::shared_ptr<Array>* out);
} // namespace ipc
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/feather.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/feather.cc b/cpp/src/arrow/ipc/feather.cc
index 1d165ac..72bbaa4 100644
--- a/cpp/src/arrow/ipc/feather.cc
+++ b/cpp/src/arrow/ipc/feather.cc
@@ -218,7 +218,7 @@ class TableReader::TableReaderImpl {
public:
TableReaderImpl() {}
- Status Open(const std::shared_ptr<io::ReadableFileInterface>& source) {
+ Status Open(const std::shared_ptr<io::RandomAccessFile>& source) {
source_ = source;
int magic_size = static_cast<int>(strlen(kFeatherMagicBytes));
@@ -386,7 +386,7 @@ class TableReader::TableReaderImpl {
}
private:
- std::shared_ptr<io::ReadableFileInterface> source_;
+ std::shared_ptr<io::RandomAccessFile> source_;
std::unique_ptr<TableMetadata> metadata_;
std::shared_ptr<Schema> schema_;
@@ -401,7 +401,7 @@ TableReader::TableReader() {
TableReader::~TableReader() {}
-Status TableReader::Open(const std::shared_ptr<io::ReadableFileInterface>& source) {
+Status TableReader::Open(const std::shared_ptr<io::RandomAccessFile>& source) {
return impl_->Open(source);
}
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/feather.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/feather.h b/cpp/src/arrow/ipc/feather.h
index 3d370df..1e4ba58 100644
--- a/cpp/src/arrow/ipc/feather.h
+++ b/cpp/src/arrow/ipc/feather.h
@@ -37,7 +37,7 @@ class Status;
namespace io {
class OutputStream;
-class ReadableFileInterface;
+class RandomAccessFile;
} // namespace io
@@ -54,7 +54,7 @@ class ARROW_EXPORT TableReader {
TableReader();
~TableReader();
- Status Open(const std::shared_ptr<io::ReadableFileInterface>& source);
+ Status Open(const std::shared_ptr<io::RandomAccessFile>& source);
static Status OpenFile(const std::string& abspath, std::unique_ptr<TableReader>* out);
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/ipc-adapter-test.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/ipc-adapter-test.cc b/cpp/src/arrow/ipc/ipc-adapter-test.cc
index 36a675f..638d98a 100644
--- a/cpp/src/arrow/ipc/ipc-adapter-test.cc
+++ b/cpp/src/arrow/ipc/ipc-adapter-test.cc
@@ -61,7 +61,7 @@ class IpcTestFixture : public io::MemoryMapFixture {
auto metadata = std::make_shared<RecordBatchMetadata>(message);
// The buffer offsets start at 0, so we must construct a
- // ReadableFileInterface according to that frame of reference
+ // RandomAccessFile according to that frame of reference
std::shared_ptr<Buffer> buffer_payload;
RETURN_NOT_OK(mmap_->ReadAt(metadata_length, body_length, &buffer_payload));
io::BufferReader buffer_reader(buffer_payload);
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/json.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/json.h b/cpp/src/arrow/ipc/json.h
index 88afdfa..0d88cef 100644
--- a/cpp/src/arrow/ipc/json.h
+++ b/cpp/src/arrow/ipc/json.h
@@ -31,7 +31,7 @@ namespace arrow {
namespace io {
class OutputStream;
-class ReadableFileInterface;
+class RandomAccessFile;
} // namespace io
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/metadata.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/metadata.cc b/cpp/src/arrow/ipc/metadata.cc
index 695e788..71bc5c9 100644
--- a/cpp/src/arrow/ipc/metadata.cc
+++ b/cpp/src/arrow/ipc/metadata.cc
@@ -359,7 +359,7 @@ const RecordBatchMetadata& DictionaryBatchMetadata::record_batch() const {
// Conveniences
Status ReadMessage(int64_t offset, int32_t metadata_length,
- io::ReadableFileInterface* file, std::shared_ptr<Message>* message) {
+ io::RandomAccessFile* file, std::shared_ptr<Message>* message) {
std::shared_ptr<Buffer> buffer;
RETURN_NOT_OK(file->ReadAt(offset, metadata_length, &buffer));
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/metadata.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/metadata.h b/cpp/src/arrow/ipc/metadata.h
index f6a0a3a..4eb0186 100644
--- a/cpp/src/arrow/ipc/metadata.h
+++ b/cpp/src/arrow/ipc/metadata.h
@@ -41,7 +41,7 @@ class Status;
namespace io {
class OutputStream;
-class ReadableFileInterface;
+class RandomAccessFile;
} // namespace io
@@ -219,7 +219,7 @@ class ARROW_EXPORT Message {
/// \param[out] message the message read
/// \return Status success or failure
Status ReadMessage(int64_t offset, int32_t metadata_length,
- io::ReadableFileInterface* file, std::shared_ptr<Message>* message);
+ io::RandomAccessFile* file, std::shared_ptr<Message>* message);
} // namespace ipc
} // namespace arrow
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/reader.cc
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/reader.cc b/cpp/src/arrow/ipc/reader.cc
index 4cb5f6c..9575364 100644
--- a/cpp/src/arrow/ipc/reader.cc
+++ b/cpp/src/arrow/ipc/reader.cc
@@ -308,7 +308,7 @@ class FileReader::FileReaderImpl {
}
Status Open(
- const std::shared_ptr<io::ReadableFileInterface>& file, int64_t footer_offset) {
+ const std::shared_ptr<io::RandomAccessFile>& file, int64_t footer_offset) {
file_ = file;
footer_offset_ = footer_offset;
RETURN_NOT_OK(ReadFooter());
@@ -318,7 +318,7 @@ class FileReader::FileReaderImpl {
std::shared_ptr<Schema> schema() const { return schema_; }
private:
- std::shared_ptr<io::ReadableFileInterface> file_;
+ std::shared_ptr<io::RandomAccessFile> file_;
// The location where the Arrow file layout ends. May be the end of the file
// or some other location if embedded in a larger file.
@@ -342,14 +342,14 @@ FileReader::FileReader() {
FileReader::~FileReader() {}
-Status FileReader::Open(const std::shared_ptr<io::ReadableFileInterface>& file,
+Status FileReader::Open(const std::shared_ptr<io::RandomAccessFile>& file,
std::shared_ptr<FileReader>* reader) {
int64_t footer_offset;
RETURN_NOT_OK(file->GetSize(&footer_offset));
return Open(file, footer_offset, reader);
}
-Status FileReader::Open(const std::shared_ptr<io::ReadableFileInterface>& file,
+Status FileReader::Open(const std::shared_ptr<io::RandomAccessFile>& file,
int64_t footer_offset, std::shared_ptr<FileReader>* reader) {
*reader = std::shared_ptr<FileReader>(new FileReader());
return (*reader)->impl_->Open(file, footer_offset);
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/cpp/src/arrow/ipc/reader.h
----------------------------------------------------------------------
diff --git a/cpp/src/arrow/ipc/reader.h b/cpp/src/arrow/ipc/reader.h
index 6f143e1..ca91765 100644
--- a/cpp/src/arrow/ipc/reader.h
+++ b/cpp/src/arrow/ipc/reader.h
@@ -37,7 +37,7 @@ class Status;
namespace io {
class InputStream;
-class ReadableFileInterface;
+class RandomAccessFile;
} // namespace io
@@ -72,7 +72,7 @@ class ARROW_EXPORT FileReader {
// can be any amount of data preceding the Arrow-formatted data, because we
// need only locate the end of the Arrow file stream to discover the metadata
// and then proceed to read the data into memory.
- static Status Open(const std::shared_ptr<io::ReadableFileInterface>& file,
+ static Status Open(const std::shared_ptr<io::RandomAccessFile>& file,
std::shared_ptr<FileReader>* reader);
// If the file is embedded within some larger file or memory region, you can
@@ -82,7 +82,7 @@ class ARROW_EXPORT FileReader {
//
// @param file: the data source
// @param footer_offset: the position of the end of the Arrow "file"
- static Status Open(const std::shared_ptr<io::ReadableFileInterface>& file,
+ static Status Open(const std::shared_ptr<io::RandomAccessFile>& file,
int64_t footer_offset, std::shared_ptr<FileReader>* reader);
/// The schema includes any dictionaries
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/_feather.pyx
----------------------------------------------------------------------
diff --git a/python/pyarrow/_feather.pyx b/python/pyarrow/_feather.pyx
index 67f734f..beb4aaa 100644
--- a/python/pyarrow/_feather.pyx
+++ b/python/pyarrow/_feather.pyx
@@ -23,7 +23,7 @@ from cython.operator cimport dereference as deref
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport CArray, CColumn, CSchema, CStatus
-from pyarrow.includes.libarrow_io cimport ReadableFileInterface, OutputStream
+from pyarrow.includes.libarrow_io cimport RandomAccessFile, OutputStream
from libcpp.string cimport string
from libcpp cimport bool as c_bool
@@ -53,7 +53,7 @@ cdef extern from "arrow/ipc/feather.h" namespace "arrow::ipc::feather" nogil:
CStatus Finalize()
cdef cppclass TableReader:
- TableReader(const shared_ptr[ReadableFileInterface]& source)
+ TableReader(const shared_ptr[RandomAccessFile]& source)
@staticmethod
CStatus OpenFile(const string& abspath, unique_ptr[TableReader]* out)
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/_parquet.pxd
----------------------------------------------------------------------
diff --git a/python/pyarrow/_parquet.pxd b/python/pyarrow/_parquet.pxd
index e106252..cf9ec8e 100644
--- a/python/pyarrow/_parquet.pxd
+++ b/python/pyarrow/_parquet.pxd
@@ -20,7 +20,7 @@
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport (CArray, CSchema, CStatus,
CTable, CMemoryPool)
-from pyarrow.includes.libarrow_io cimport ReadableFileInterface, OutputStream
+from pyarrow.includes.libarrow_io cimport RandomAccessFile, OutputStream
cdef extern from "parquet/api/schema.h" namespace "parquet::schema" nogil:
@@ -173,7 +173,7 @@ cdef extern from "parquet/api/reader.h" namespace "parquet" nogil:
cdef cppclass ParquetFileReader:
@staticmethod
unique_ptr[ParquetFileReader] Open(
- const shared_ptr[ReadableFileInterface]& file,
+ const shared_ptr[RandomAccessFile]& file,
const ReaderProperties& props,
const shared_ptr[CFileMetaData]& metadata)
@@ -203,7 +203,7 @@ cdef extern from "parquet/api/writer.h" namespace "parquet" nogil:
cdef extern from "parquet/arrow/reader.h" namespace "parquet::arrow" nogil:
- CStatus OpenFile(const shared_ptr[ReadableFileInterface]& file,
+ CStatus OpenFile(const shared_ptr[RandomAccessFile]& file,
CMemoryPool* allocator,
const ReaderProperties& properties,
const shared_ptr[CFileMetaData]& metadata,
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/_parquet.pyx
----------------------------------------------------------------------
diff --git a/python/pyarrow/_parquet.pyx b/python/pyarrow/_parquet.pyx
index 08c7bb5..8e67da9 100644
--- a/python/pyarrow/_parquet.pyx
+++ b/python/pyarrow/_parquet.pyx
@@ -23,7 +23,7 @@ from cython.operator cimport dereference as deref
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport *
-from pyarrow.includes.libarrow_io cimport (ReadableFileInterface, OutputStream,
+from pyarrow.includes.libarrow_io cimport (RandomAccessFile, OutputStream,
FileOutputStream)
cimport pyarrow.includes.pyarrow as pyarrow
@@ -354,7 +354,7 @@ cdef class ParquetReader:
def open(self, object source, FileMetaData metadata=None):
cdef:
- shared_ptr[ReadableFileInterface] rd_handle
+ shared_ptr[RandomAccessFile] rd_handle
shared_ptr[CFileMetaData] c_metadata
ReaderProperties properties = default_reader_properties()
c_string path
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/includes/libarrow_io.pxd
----------------------------------------------------------------------
diff --git a/python/pyarrow/includes/libarrow_io.pxd b/python/pyarrow/includes/libarrow_io.pxd
index 8d0d524..5992c73 100644
--- a/python/pyarrow/includes/libarrow_io.pxd
+++ b/python/pyarrow/includes/libarrow_io.pxd
@@ -51,7 +51,7 @@ cdef extern from "arrow/io/interfaces.h" namespace "arrow::io" nogil:
cdef cppclass InputStream(FileInterface, Readable):
pass
- cdef cppclass ReadableFileInterface(InputStream, Seekable):
+ cdef cppclass RandomAccessFile(InputStream, Seekable):
CStatus GetSize(int64_t* size)
CStatus ReadAt(int64_t position, int64_t nbytes,
@@ -63,7 +63,7 @@ cdef extern from "arrow/io/interfaces.h" namespace "arrow::io" nogil:
CStatus WriteAt(int64_t position, const uint8_t* data,
int64_t nbytes)
- cdef cppclass ReadWriteFileInterface(ReadableFileInterface,
+ cdef cppclass ReadWriteFileInterface(RandomAccessFile,
WriteableFileInterface):
pass
@@ -77,7 +77,7 @@ cdef extern from "arrow/io/file.h" namespace "arrow::io" nogil:
int file_descriptor()
- cdef cppclass ReadableFile(ReadableFileInterface):
+ cdef cppclass ReadableFile(RandomAccessFile):
@staticmethod
CStatus Open(const c_string& path, shared_ptr[ReadableFile]* file)
@@ -123,7 +123,7 @@ cdef extern from "arrow/io/hdfs.h" namespace "arrow::io" nogil:
int64_t block_size
int16_t permissions
- cdef cppclass HdfsReadableFile(ReadableFileInterface):
+ cdef cppclass HdfsReadableFile(RandomAccessFile):
pass
cdef cppclass HdfsOutputStream(OutputStream):
@@ -163,7 +163,7 @@ cdef extern from "arrow/io/hdfs.h" namespace "arrow::io" nogil:
cdef extern from "arrow/io/memory.h" namespace "arrow::io" nogil:
cdef cppclass CBufferReader" arrow::io::BufferReader"\
- (ReadableFileInterface):
+ (RandomAccessFile):
CBufferReader(const shared_ptr[CBuffer]& buffer)
CBufferReader(const uint8_t* data, int64_t nbytes)
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/includes/libarrow_ipc.pxd
----------------------------------------------------------------------
diff --git a/python/pyarrow/includes/libarrow_ipc.pxd b/python/pyarrow/includes/libarrow_ipc.pxd
index 10c70a9..8b7d705 100644
--- a/python/pyarrow/includes/libarrow_ipc.pxd
+++ b/python/pyarrow/includes/libarrow_ipc.pxd
@@ -20,7 +20,7 @@
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport (CArray, CSchema, CRecordBatch)
from pyarrow.includes.libarrow_io cimport (InputStream, OutputStream,
- ReadableFileInterface)
+ RandomAccessFile)
cdef extern from "arrow/ipc/api.h" namespace "arrow::ipc" nogil:
@@ -51,11 +51,11 @@ cdef extern from "arrow/ipc/api.h" namespace "arrow::ipc" nogil:
cdef cppclass CFileReader " arrow::ipc::FileReader":
@staticmethod
- CStatus Open(const shared_ptr[ReadableFileInterface]& file,
+ CStatus Open(const shared_ptr[RandomAccessFile]& file,
shared_ptr[CFileReader]* out)
@staticmethod
- CStatus Open2" Open"(const shared_ptr[ReadableFileInterface]& file,
+ CStatus Open2" Open"(const shared_ptr[RandomAccessFile]& file,
int64_t footer_offset, shared_ptr[CFileReader]* out)
shared_ptr[CSchema] schema()
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/includes/pyarrow.pxd
----------------------------------------------------------------------
diff --git a/python/pyarrow/includes/pyarrow.pxd b/python/pyarrow/includes/pyarrow.pxd
index 9fbddba..805950b 100644
--- a/python/pyarrow/includes/pyarrow.pxd
+++ b/python/pyarrow/includes/pyarrow.pxd
@@ -60,7 +60,7 @@ cdef extern from "pyarrow/common.h" namespace "arrow::py" nogil:
cdef extern from "pyarrow/io.h" namespace "arrow::py" nogil:
- cdef cppclass PyReadableFile(arrow_io.ReadableFileInterface):
+ cdef cppclass PyReadableFile(arrow_io.RandomAccessFile):
PyReadableFile(object fo)
cdef cppclass PyOutputStream(arrow_io.OutputStream):
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/io.pxd
----------------------------------------------------------------------
diff --git a/python/pyarrow/io.pxd b/python/pyarrow/io.pxd
index 3d73e11..cffd29a 100644
--- a/python/pyarrow/io.pxd
+++ b/python/pyarrow/io.pxd
@@ -19,7 +19,7 @@
from pyarrow.includes.common cimport *
from pyarrow.includes.libarrow cimport *
-from pyarrow.includes.libarrow_io cimport (ReadableFileInterface,
+from pyarrow.includes.libarrow_io cimport (RandomAccessFile,
OutputStream)
cdef class Buffer:
@@ -32,7 +32,7 @@ cdef class Buffer:
cdef class NativeFile:
cdef:
- shared_ptr[ReadableFileInterface] rd_file
+ shared_ptr[RandomAccessFile] rd_file
shared_ptr[OutputStream] wr_file
bint is_readable
bint is_writeable
@@ -43,8 +43,8 @@ cdef class NativeFile:
# extension classes are technically virtual in the C++ sense) we can expose
# the arrow::io abstract file interfaces to other components throughout the
# suite of Arrow C++ libraries
- cdef read_handle(self, shared_ptr[ReadableFileInterface]* file)
+ cdef read_handle(self, shared_ptr[RandomAccessFile]* file)
cdef write_handle(self, shared_ptr[OutputStream]* file)
-cdef get_reader(object source, shared_ptr[ReadableFileInterface]* reader)
+cdef get_reader(object source, shared_ptr[RandomAccessFile]* reader)
cdef get_writer(object source, shared_ptr[OutputStream]* writer)
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/pyarrow/io.pyx
----------------------------------------------------------------------
diff --git a/python/pyarrow/io.pyx b/python/pyarrow/io.pyx
index 240ea24..17b43de 100644
--- a/python/pyarrow/io.pyx
+++ b/python/pyarrow/io.pyx
@@ -81,9 +81,9 @@ cdef class NativeFile:
check_status(self.wr_file.get().Close())
self.is_open = False
- cdef read_handle(self, shared_ptr[ReadableFileInterface]* file):
+ cdef read_handle(self, shared_ptr[RandomAccessFile]* file):
self._assert_readable()
- file[0] = <shared_ptr[ReadableFileInterface]> self.rd_file
+ file[0] = <shared_ptr[RandomAccessFile]> self.rd_file
cdef write_handle(self, shared_ptr[OutputStream]* file):
self._assert_writeable()
@@ -361,7 +361,7 @@ cdef class MemoryMappedFile(NativeFile):
check_status(CMemoryMappedFile.Open(c_path, c_mode, &handle))
self.wr_file = <shared_ptr[OutputStream]> handle
- self.rd_file = <shared_ptr[ReadableFileInterface]> handle
+ self.rd_file = <shared_ptr[RandomAccessFile]> handle
self.is_open = True
@@ -398,7 +398,7 @@ cdef class OSFile(NativeFile):
check_status(ReadableFile.Open(path, pool, &handle))
self.is_readable = 1
- self.rd_file = <shared_ptr[ReadableFileInterface]> handle
+ self.rd_file = <shared_ptr[RandomAccessFile]> handle
cdef _open_writeable(self, c_string path):
cdef shared_ptr[FileOutputStream] handle
@@ -536,7 +536,7 @@ cdef Buffer wrap_buffer(const shared_ptr[CBuffer]& buf):
return result
-cdef get_reader(object source, shared_ptr[ReadableFileInterface]* reader):
+cdef get_reader(object source, shared_ptr[RandomAccessFile]* reader):
cdef NativeFile nf
if isinstance(source, six.string_types):
@@ -815,7 +815,7 @@ cdef class _HdfsClient:
check_status(self.client.get()
.OpenReadable(c_path, &rd_handle))
- out.rd_file = <shared_ptr[ReadableFileInterface]> rd_handle
+ out.rd_file = <shared_ptr[RandomAccessFile]> rd_handle
out.is_readable = True
out.is_writeable = 0
@@ -924,7 +924,7 @@ cdef class _StreamReader:
def _open(self, source):
cdef:
- shared_ptr[ReadableFileInterface] reader
+ shared_ptr[RandomAccessFile] reader
shared_ptr[InputStream] in_stream
get_reader(source, &reader)
@@ -996,7 +996,7 @@ cdef class _FileReader:
pass
def _open(self, source, footer_offset=None):
- cdef shared_ptr[ReadableFileInterface] reader
+ cdef shared_ptr[RandomAccessFile] reader
get_reader(source, &reader)
cdef int64_t offset = 0
http://git-wip-us.apache.org/repos/asf/arrow/blob/3ee3822b/python/src/pyarrow/io.h
----------------------------------------------------------------------
diff --git a/python/src/pyarrow/io.h b/python/src/pyarrow/io.h
index a603e81..e38cd81 100644
--- a/python/src/pyarrow/io.h
+++ b/python/src/pyarrow/io.h
@@ -49,7 +49,7 @@ class PythonFile {
PyObject* file_;
};
-class ARROW_EXPORT PyReadableFile : public io::ReadableFileInterface {
+class ARROW_EXPORT PyReadableFile : public io::RandomAccessFile {
public:
explicit PyReadableFile(PyObject* file);
virtual ~PyReadableFile();