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/04/12 14:54:51 UTC
[3/4] arrow git commit: ARROW-810: [GLib] Remove io/ipc prefix
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-file.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-file.cpp b/c_glib/arrow-glib/io-file.cpp
deleted file mode 100644
index 536ae3e..0000000
--- a/c_glib/arrow-glib/io-file.cpp
+++ /dev/null
@@ -1,116 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-file.hpp>
-#include <arrow-glib/io-file-mode.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-file
- * @title: GArrowIOFile
- * @short_description: File interface
- *
- * #GArrowIOFile is an interface for file.
- */
-
-G_DEFINE_INTERFACE(GArrowIOFile,
- garrow_io_file,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_file_default_init (GArrowIOFileInterface *iface)
-{
-}
-
-/**
- * garrow_io_file_close:
- * @file: A #GArrowIOFile.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_io_file_close(GArrowIOFile *file,
- GError **error)
-{
- auto arrow_file = garrow_io_file_get_raw(file);
-
- auto status = arrow_file->Close();
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[io][file][close]");
- return FALSE;
- }
-}
-
-/**
- * garrow_io_file_tell:
- * @file: A #GArrowIOFile.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: The current offset on success, -1 if there was an error.
- */
-gint64
-garrow_io_file_tell(GArrowIOFile *file,
- GError **error)
-{
- auto arrow_file = garrow_io_file_get_raw(file);
-
- gint64 position;
- auto status = arrow_file->Tell(&position);
- if (status.ok()) {
- return position;
- } else {
- garrow_error_set(error, status, "[io][file][tell]");
- return -1;
- }
-}
-
-/**
- * garrow_io_file_get_mode:
- * @file: A #GArrowIOFile.
- *
- * Returns: The mode of the file.
- */
-GArrowIOFileMode
-garrow_io_file_get_mode(GArrowIOFile *file)
-{
- auto arrow_file = garrow_io_file_get_raw(file);
-
- auto arrow_mode = arrow_file->mode();
- return garrow_io_file_mode_from_raw(arrow_mode);
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::FileInterface>
-garrow_io_file_get_raw(GArrowIOFile *file)
-{
- auto *iface = GARROW_IO_FILE_GET_IFACE(file);
- return iface->get_raw(file);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-file.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-file.h b/c_glib/arrow-glib/io-file.h
deleted file mode 100644
index 7181f6d..0000000
--- a/c_glib/arrow-glib/io-file.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow-glib/io-file-mode.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_FILE \
- (garrow_io_file_get_type())
-#define GARROW_IO_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_FILE, \
- GArrowIOFile))
-#define GARROW_IO_IS_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_FILE))
-#define GARROW_IO_FILE_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_FILE, \
- GArrowIOFileInterface))
-
-typedef struct _GArrowIOFile GArrowIOFile;
-typedef struct _GArrowIOFileInterface GArrowIOFileInterface;
-
-GType garrow_io_file_get_type(void) G_GNUC_CONST;
-
-gboolean garrow_io_file_close(GArrowIOFile *file,
- GError **error);
-gint64 garrow_io_file_tell(GArrowIOFile *file,
- GError **error);
-GArrowIOFileMode garrow_io_file_get_mode(GArrowIOFile *file);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-file.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-file.hpp b/c_glib/arrow-glib/io-file.hpp
deleted file mode 100644
index afaca90..0000000
--- a/c_glib/arrow-glib/io-file.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-file.h>
-
-/**
- * GArrowIOFileInterface:
- *
- * It wraps `arrow::io::FileInterface`.
- */
-struct _GArrowIOFileInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::FileInterface> (*get_raw)(GArrowIOFile *file);
-};
-
-std::shared_ptr<arrow::io::FileInterface> garrow_io_file_get_raw(GArrowIOFile *file);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-input-stream.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-input-stream.cpp b/c_glib/arrow-glib/io-input-stream.cpp
deleted file mode 100644
index a28b9c6..0000000
--- a/c_glib/arrow-glib/io-input-stream.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-input-stream.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-input-stream
- * @title: GArrowIOInputStream
- * @short_description: Stream input interface
- *
- * #GArrowIOInputStream is an interface for stream input. Stream input
- * is file based and readable.
- */
-
-G_DEFINE_INTERFACE(GArrowIOInputStream,
- garrow_io_input_stream,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_input_stream_default_init (GArrowIOInputStreamInterface *iface)
-{
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::InputStream>
-garrow_io_input_stream_get_raw(GArrowIOInputStream *input_stream)
-{
- auto *iface = GARROW_IO_INPUT_STREAM_GET_IFACE(input_stream);
- return iface->get_raw(input_stream);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-input-stream.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-input-stream.h b/c_glib/arrow-glib/io-input-stream.h
deleted file mode 100644
index 5790209..0000000
--- a/c_glib/arrow-glib/io-input-stream.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_INPUT_STREAM \
- (garrow_io_input_stream_get_type())
-#define GARROW_IO_INPUT_STREAM(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_INPUT_STREAM, \
- GArrowIOInputStream))
-#define GARROW_IO_IS_INPUT_STREAM(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_INPUT_STREAM))
-#define GARROW_IO_INPUT_STREAM_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_INPUT_STREAM, \
- GArrowIOInputStreamInterface))
-
-typedef struct _GArrowIOInputStream GArrowIOInputStream;
-typedef struct _GArrowIOInputStreamInterface GArrowIOInputStreamInterface;
-
-GType garrow_io_input_stream_get_type(void) G_GNUC_CONST;
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-input-stream.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-input-stream.hpp b/c_glib/arrow-glib/io-input-stream.hpp
deleted file mode 100644
index 3b1de5d..0000000
--- a/c_glib/arrow-glib/io-input-stream.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-input-stream.h>
-
-/**
- * GArrowIOInputStreamInterface:
- *
- * It wraps `arrow::io::InputStream`.
- */
-struct _GArrowIOInputStreamInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::InputStream> (*get_raw)(GArrowIOInputStream *file);
-};
-
-std::shared_ptr<arrow::io::InputStream> garrow_io_input_stream_get_raw(GArrowIOInputStream *input_stream);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-memory-mapped-file.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-memory-mapped-file.cpp b/c_glib/arrow-glib/io-memory-mapped-file.cpp
deleted file mode 100644
index e2e255c..0000000
--- a/c_glib/arrow-glib/io-memory-mapped-file.cpp
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/io/file.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-file.hpp>
-#include <arrow-glib/io-file-mode.hpp>
-#include <arrow-glib/io-input-stream.hpp>
-#include <arrow-glib/io-memory-mapped-file.hpp>
-#include <arrow-glib/io-readable.hpp>
-#include <arrow-glib/io-random-access-file.hpp>
-#include <arrow-glib/io-writeable.hpp>
-#include <arrow-glib/io-writeable-file.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-memory-mapped-file
- * @short_description: Memory mapped file class
- *
- * #GArrowIOMemoryMappedFile is a class for memory mapped file. It's
- * readable and writeable. It supports zero copy.
- */
-
-typedef struct GArrowIOMemoryMappedFilePrivate_ {
- std::shared_ptr<arrow::io::MemoryMappedFile> memory_mapped_file;
-} GArrowIOMemoryMappedFilePrivate;
-
-enum {
- PROP_0,
- PROP_MEMORY_MAPPED_FILE
-};
-
-static std::shared_ptr<arrow::io::FileInterface>
-garrow_io_memory_mapped_file_get_raw_file_interface(GArrowIOFile *file)
-{
- auto memory_mapped_file = GARROW_IO_MEMORY_MAPPED_FILE(file);
- auto arrow_memory_mapped_file =
- garrow_io_memory_mapped_file_get_raw(memory_mapped_file);
- return arrow_memory_mapped_file;
-}
-
-static void
-garrow_io_file_interface_init(GArrowIOFileInterface *iface)
-{
- iface->get_raw = garrow_io_memory_mapped_file_get_raw_file_interface;
-}
-
-static std::shared_ptr<arrow::io::Readable>
-garrow_io_memory_mapped_file_get_raw_readable_interface(GArrowIOReadable *readable)
-{
- auto memory_mapped_file = GARROW_IO_MEMORY_MAPPED_FILE(readable);
- auto arrow_memory_mapped_file =
- garrow_io_memory_mapped_file_get_raw(memory_mapped_file);
- return arrow_memory_mapped_file;
-}
-
-static void
-garrow_io_readable_interface_init(GArrowIOReadableInterface *iface)
-{
- iface->get_raw = garrow_io_memory_mapped_file_get_raw_readable_interface;
-}
-
-static std::shared_ptr<arrow::io::InputStream>
-garrow_io_memory_mapped_file_get_raw_input_stream_interface(GArrowIOInputStream *input_stream)
-{
- auto memory_mapped_file = GARROW_IO_MEMORY_MAPPED_FILE(input_stream);
- auto arrow_memory_mapped_file =
- garrow_io_memory_mapped_file_get_raw(memory_mapped_file);
- return arrow_memory_mapped_file;
-}
-
-static void
-garrow_io_input_stream_interface_init(GArrowIOInputStreamInterface *iface)
-{
- iface->get_raw = garrow_io_memory_mapped_file_get_raw_input_stream_interface;
-}
-
-static std::shared_ptr<arrow::io::RandomAccessFile>
-garrow_io_memory_mapped_file_get_raw_random_access_file_interface(GArrowIORandomAccessFile *file)
-{
- auto memory_mapped_file = GARROW_IO_MEMORY_MAPPED_FILE(file);
- auto arrow_memory_mapped_file =
- garrow_io_memory_mapped_file_get_raw(memory_mapped_file);
- return arrow_memory_mapped_file;
-}
-
-static void
-garrow_io_random_access_file_interface_init(GArrowIORandomAccessFileInterface *iface)
-{
- iface->get_raw = garrow_io_memory_mapped_file_get_raw_random_access_file_interface;
-}
-
-static std::shared_ptr<arrow::io::Writeable>
-garrow_io_memory_mapped_file_get_raw_writeable_interface(GArrowIOWriteable *writeable)
-{
- auto memory_mapped_file = GARROW_IO_MEMORY_MAPPED_FILE(writeable);
- auto arrow_memory_mapped_file =
- garrow_io_memory_mapped_file_get_raw(memory_mapped_file);
- return arrow_memory_mapped_file;
-}
-
-static void
-garrow_io_writeable_interface_init(GArrowIOWriteableInterface *iface)
-{
- iface->get_raw = garrow_io_memory_mapped_file_get_raw_writeable_interface;
-}
-
-static std::shared_ptr<arrow::io::WriteableFile>
-garrow_io_memory_mapped_file_get_raw_writeable_file_interface(GArrowIOWriteableFile *file)
-{
- auto memory_mapped_file = GARROW_IO_MEMORY_MAPPED_FILE(file);
- auto arrow_memory_mapped_file =
- garrow_io_memory_mapped_file_get_raw(memory_mapped_file);
- return arrow_memory_mapped_file;
-}
-
-static void
-garrow_io_writeable_file_interface_init(GArrowIOWriteableFileInterface *iface)
-{
- iface->get_raw = garrow_io_memory_mapped_file_get_raw_writeable_file_interface;
-}
-
-G_DEFINE_TYPE_WITH_CODE(GArrowIOMemoryMappedFile,
- garrow_io_memory_mapped_file,
- G_TYPE_OBJECT,
- G_ADD_PRIVATE(GArrowIOMemoryMappedFile)
- G_IMPLEMENT_INTERFACE(GARROW_IO_TYPE_FILE,
- garrow_io_file_interface_init)
- G_IMPLEMENT_INTERFACE(GARROW_IO_TYPE_READABLE,
- garrow_io_readable_interface_init)
- G_IMPLEMENT_INTERFACE(GARROW_IO_TYPE_INPUT_STREAM,
- garrow_io_input_stream_interface_init)
- G_IMPLEMENT_INTERFACE(GARROW_IO_TYPE_RANDOM_ACCESS_FILE,
- garrow_io_random_access_file_interface_init)
- G_IMPLEMENT_INTERFACE(GARROW_IO_TYPE_WRITEABLE,
- garrow_io_writeable_interface_init)
- G_IMPLEMENT_INTERFACE(GARROW_IO_TYPE_WRITEABLE_FILE,
- garrow_io_writeable_file_interface_init));
-
-#define GARROW_IO_MEMORY_MAPPED_FILE_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
- GARROW_IO_TYPE_MEMORY_MAPPED_FILE, \
- GArrowIOMemoryMappedFilePrivate))
-
-static void
-garrow_io_memory_mapped_file_finalize(GObject *object)
-{
- GArrowIOMemoryMappedFilePrivate *priv;
-
- priv = GARROW_IO_MEMORY_MAPPED_FILE_GET_PRIVATE(object);
-
- priv->memory_mapped_file = nullptr;
-
- G_OBJECT_CLASS(garrow_io_memory_mapped_file_parent_class)->finalize(object);
-}
-
-static void
-garrow_io_memory_mapped_file_set_property(GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GArrowIOMemoryMappedFilePrivate *priv;
-
- priv = GARROW_IO_MEMORY_MAPPED_FILE_GET_PRIVATE(object);
-
- switch (prop_id) {
- case PROP_MEMORY_MAPPED_FILE:
- priv->memory_mapped_file =
- *static_cast<std::shared_ptr<arrow::io::MemoryMappedFile> *>(g_value_get_pointer(value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-
-static void
-garrow_io_memory_mapped_file_get_property(GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-
-static void
-garrow_io_memory_mapped_file_init(GArrowIOMemoryMappedFile *object)
-{
-}
-
-static void
-garrow_io_memory_mapped_file_class_init(GArrowIOMemoryMappedFileClass *klass)
-{
- GObjectClass *gobject_class;
- GParamSpec *spec;
-
- gobject_class = G_OBJECT_CLASS(klass);
-
- gobject_class->finalize = garrow_io_memory_mapped_file_finalize;
- gobject_class->set_property = garrow_io_memory_mapped_file_set_property;
- gobject_class->get_property = garrow_io_memory_mapped_file_get_property;
-
- spec = g_param_spec_pointer("memory-mapped-file",
- "io::MemoryMappedFile",
- "The raw std::shared<arrow::io::MemoryMappedFile> *",
- static_cast<GParamFlags>(G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property(gobject_class, PROP_MEMORY_MAPPED_FILE, spec);
-}
-
-/**
- * garrow_io_memory_mapped_file_open:
- * @path: The path of the memory mapped file.
- * @mode: The mode of the memory mapped file.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: (nullable) (transfer full): A newly opened
- * #GArrowIOMemoryMappedFile or %NULL on error.
- */
-GArrowIOMemoryMappedFile *
-garrow_io_memory_mapped_file_open(const gchar *path,
- GArrowIOFileMode mode,
- GError **error)
-{
- std::shared_ptr<arrow::io::MemoryMappedFile> arrow_memory_mapped_file;
- auto status =
- arrow::io::MemoryMappedFile::Open(std::string(path),
- garrow_io_file_mode_to_raw(mode),
- &arrow_memory_mapped_file);
- if (status.ok()) {
- return garrow_io_memory_mapped_file_new_raw(&arrow_memory_mapped_file);
- } else {
- std::string context("[io][memory-mapped-file][open]: <");
- context += path;
- context += ">";
- garrow_error_set(error, status, context.c_str());
- return NULL;
- }
-}
-
-G_END_DECLS
-
-GArrowIOMemoryMappedFile *
-garrow_io_memory_mapped_file_new_raw(std::shared_ptr<arrow::io::MemoryMappedFile> *arrow_memory_mapped_file)
-{
- auto memory_mapped_file =
- GARROW_IO_MEMORY_MAPPED_FILE(g_object_new(GARROW_IO_TYPE_MEMORY_MAPPED_FILE,
- "memory-mapped-file", arrow_memory_mapped_file,
- NULL));
- return memory_mapped_file;
-}
-
-std::shared_ptr<arrow::io::MemoryMappedFile>
-garrow_io_memory_mapped_file_get_raw(GArrowIOMemoryMappedFile *memory_mapped_file)
-{
- GArrowIOMemoryMappedFilePrivate *priv;
-
- priv = GARROW_IO_MEMORY_MAPPED_FILE_GET_PRIVATE(memory_mapped_file);
- return priv->memory_mapped_file;
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-memory-mapped-file.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-memory-mapped-file.h b/c_glib/arrow-glib/io-memory-mapped-file.h
deleted file mode 100644
index 0d2d6c2..0000000
--- a/c_glib/arrow-glib/io-memory-mapped-file.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow-glib/io-file-mode.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_MEMORY_MAPPED_FILE \
- (garrow_io_memory_mapped_file_get_type())
-#define GARROW_IO_MEMORY_MAPPED_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_MEMORY_MAPPED_FILE, \
- GArrowIOMemoryMappedFile))
-#define GARROW_IO_MEMORY_MAPPED_FILE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), \
- GARROW_IO_TYPE_MEMORY_MAPPED_FILE, \
- GArrowIOMemoryMappedFileClass))
-#define GARROW_IO_IS_MEMORY_MAPPED_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_MEMORY_MAPPED_FILE))
-#define GARROW_IO_IS_MEMORY_MAPPED_FILE_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), \
- GARROW_IO_TYPE_MEMORY_MAPPED_FILE))
-#define GARROW_IO_MEMORY_MAPPED_FILE_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS((obj), \
- GARROW_IO_TYPE_MEMORY_MAPPED_FILE, \
- GArrowIOMemoryMappedFileClass))
-
-typedef struct _GArrowIOMemoryMappedFile GArrowIOMemoryMappedFile;
-typedef struct _GArrowIOMemoryMappedFileClass GArrowIOMemoryMappedFileClass;
-
-/**
- * GArrowIOMemoryMappedFile:
- *
- * It wraps `arrow::io::MemoryMappedFile`.
- */
-struct _GArrowIOMemoryMappedFile
-{
- /*< private >*/
- GObject parent_instance;
-};
-
-struct _GArrowIOMemoryMappedFileClass
-{
- GObjectClass parent_class;
-};
-
-GType garrow_io_memory_mapped_file_get_type(void) G_GNUC_CONST;
-
-GArrowIOMemoryMappedFile *garrow_io_memory_mapped_file_open(const gchar *path,
- GArrowIOFileMode mode,
- GError **error);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-memory-mapped-file.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-memory-mapped-file.hpp b/c_glib/arrow-glib/io-memory-mapped-file.hpp
deleted file mode 100644
index b48e05f..0000000
--- a/c_glib/arrow-glib/io-memory-mapped-file.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/api.h>
-#include <arrow/io/file.h>
-
-#include <arrow-glib/io-memory-mapped-file.h>
-
-GArrowIOMemoryMappedFile *garrow_io_memory_mapped_file_new_raw(std::shared_ptr<arrow::io::MemoryMappedFile> *arrow_memory_mapped_file);
-std::shared_ptr<arrow::io::MemoryMappedFile> garrow_io_memory_mapped_file_get_raw(GArrowIOMemoryMappedFile *memory_mapped_file);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-output-stream.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-output-stream.cpp b/c_glib/arrow-glib/io-output-stream.cpp
deleted file mode 100644
index bdf5587..0000000
--- a/c_glib/arrow-glib/io-output-stream.cpp
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-output-stream.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-output-stream
- * @title: GArrowIOOutputStream
- * @short_description: Stream output interface
- *
- * #GArrowIOOutputStream is an interface for stream output. Stream
- * output is file based and writeable
- */
-
-G_DEFINE_INTERFACE(GArrowIOOutputStream,
- garrow_io_output_stream,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_output_stream_default_init (GArrowIOOutputStreamInterface *iface)
-{
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::OutputStream>
-garrow_io_output_stream_get_raw(GArrowIOOutputStream *output_stream)
-{
- auto *iface = GARROW_IO_OUTPUT_STREAM_GET_IFACE(output_stream);
- return iface->get_raw(output_stream);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-output-stream.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-output-stream.h b/c_glib/arrow-glib/io-output-stream.h
deleted file mode 100644
index 02478ce..0000000
--- a/c_glib/arrow-glib/io-output-stream.h
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_OUTPUT_STREAM \
- (garrow_io_output_stream_get_type())
-#define GARROW_IO_OUTPUT_STREAM(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_OUTPUT_STREAM, \
- GArrowIOOutputStream))
-#define GARROW_IO_IS_OUTPUT_STREAM(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_OUTPUT_STREAM))
-#define GARROW_IO_OUTPUT_STREAM_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_OUTPUT_STREAM, \
- GArrowIOOutputStreamInterface))
-
-typedef struct _GArrowIOOutputStream GArrowIOOutputStream;
-typedef struct _GArrowIOOutputStreamInterface GArrowIOOutputStreamInterface;
-
-GType garrow_io_output_stream_get_type(void) G_GNUC_CONST;
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-output-stream.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-output-stream.hpp b/c_glib/arrow-glib/io-output-stream.hpp
deleted file mode 100644
index f144130..0000000
--- a/c_glib/arrow-glib/io-output-stream.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-output-stream.h>
-
-/**
- * GArrowIOOutputStreamInterface:
- *
- * It wraps `arrow::io::OutputStream`.
- */
-struct _GArrowIOOutputStreamInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::OutputStream> (*get_raw)(GArrowIOOutputStream *file);
-};
-
-std::shared_ptr<arrow::io::OutputStream> garrow_io_output_stream_get_raw(GArrowIOOutputStream *output_stream);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-random-access-file.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-random-access-file.cpp b/c_glib/arrow-glib/io-random-access-file.cpp
deleted file mode 100644
index 552b879..0000000
--- a/c_glib/arrow-glib/io-random-access-file.cpp
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-random-access-file.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-random-access-file
- * @title: GArrowIORandomAccessFile
- * @short_description: File input interface
- *
- * #GArrowIORandomAccessFile is an interface for file input.
- */
-
-G_DEFINE_INTERFACE(GArrowIORandomAccessFile,
- garrow_io_random_access_file,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_random_access_file_default_init (GArrowIORandomAccessFileInterface *iface)
-{
-}
-
-/**
- * garrow_io_random_access_file_get_size:
- * @file: A #GArrowIORandomAccessFile.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: The size of the file.
- */
-guint64
-garrow_io_random_access_file_get_size(GArrowIORandomAccessFile *file,
- GError **error)
-{
- auto *iface = GARROW_IO_RANDOM_ACCESS_FILE_GET_IFACE(file);
- auto arrow_random_access_file = iface->get_raw(file);
- int64_t size;
-
- auto status = arrow_random_access_file->GetSize(&size);
- if (status.ok()) {
- return size;
- } else {
- garrow_error_set(error, status, "[io][random-access-file][get-size]");
- return 0;
- }
-}
-
-/**
- * garrow_io_random_access_file_get_support_zero_copy:
- * @file: A #GArrowIORandomAccessFile.
- *
- * Returns: Whether zero copy read is supported or not.
- */
-gboolean
-garrow_io_random_access_file_get_support_zero_copy(GArrowIORandomAccessFile *file)
-{
- auto *iface = GARROW_IO_RANDOM_ACCESS_FILE_GET_IFACE(file);
- auto arrow_random_access_file = iface->get_raw(file);
-
- return arrow_random_access_file->supports_zero_copy();
-}
-
-/**
- * garrow_io_random_access_file_read_at:
- * @file: A #GArrowIORandomAccessFile.
- * @position: The read start position.
- * @n_bytes: The number of bytes to be read.
- * @n_read_bytes: (out): The read number of bytes.
- * @buffer: (array length=n_bytes): The buffer to be read data.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_io_random_access_file_read_at(GArrowIORandomAccessFile *file,
- gint64 position,
- gint64 n_bytes,
- gint64 *n_read_bytes,
- guint8 *buffer,
- GError **error)
-{
- const auto arrow_random_access_file =
- garrow_io_random_access_file_get_raw(file);
-
- auto status = arrow_random_access_file->ReadAt(position,
- n_bytes,
- n_read_bytes,
- buffer);
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[io][random-access-file][read-at]");
- return FALSE;
- }
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::RandomAccessFile>
-garrow_io_random_access_file_get_raw(GArrowIORandomAccessFile *random_access_file)
-{
- auto *iface = GARROW_IO_RANDOM_ACCESS_FILE_GET_IFACE(random_access_file);
- return iface->get_raw(random_access_file);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-random-access-file.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-random-access-file.h b/c_glib/arrow-glib/io-random-access-file.h
deleted file mode 100644
index 8ac63e4..0000000
--- a/c_glib/arrow-glib/io-random-access-file.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_RANDOM_ACCESS_FILE \
- (garrow_io_random_access_file_get_type())
-#define GARROW_IO_RANDOM_ACCESS_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_RANDOM_ACCESS_FILE, \
- GArrowIORandomAccessFile))
-#define GARROW_IO_IS_RANDOM_ACCESS_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_RANDOM_ACCESS_FILE))
-#define GARROW_IO_RANDOM_ACCESS_FILE_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_RANDOM_ACCESS_FILE, \
- GArrowIORandomAccessFileInterface))
-
-typedef struct _GArrowIORandomAccessFile GArrowIORandomAccessFile;
-typedef struct _GArrowIORandomAccessFileInterface GArrowIORandomAccessFileInterface;
-
-GType garrow_io_random_access_file_get_type(void) G_GNUC_CONST;
-
-guint64 garrow_io_random_access_file_get_size(GArrowIORandomAccessFile *file,
- GError **error);
-gboolean garrow_io_random_access_file_get_support_zero_copy(GArrowIORandomAccessFile *file);
-gboolean garrow_io_random_access_file_read_at(GArrowIORandomAccessFile *file,
- gint64 position,
- gint64 n_bytes,
- gint64 *n_read_bytes,
- guint8 *buffer,
- GError **error);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-random-access-file.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-random-access-file.hpp b/c_glib/arrow-glib/io-random-access-file.hpp
deleted file mode 100644
index 7c97c9e..0000000
--- a/c_glib/arrow-glib/io-random-access-file.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-random-access-file.h>
-
-/**
- * GArrowIORandomAccessFileInterface:
- *
- * It wraps `arrow::io::RandomAccessFile`.
- */
-struct _GArrowIORandomAccessFileInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::RandomAccessFile> (*get_raw)(GArrowIORandomAccessFile *file);
-};
-
-std::shared_ptr<arrow::io::RandomAccessFile> garrow_io_random_access_file_get_raw(GArrowIORandomAccessFile *random_access_file);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-readable.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-readable.cpp b/c_glib/arrow-glib/io-readable.cpp
deleted file mode 100644
index b372a66..0000000
--- a/c_glib/arrow-glib/io-readable.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-readable.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-readable
- * @title: GArrowIOReadable
- * @short_description: Input interface
- *
- * #GArrowIOReadable is an interface for input. Input must be
- * readable.
- */
-
-G_DEFINE_INTERFACE(GArrowIOReadable,
- garrow_io_readable,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_readable_default_init (GArrowIOReadableInterface *iface)
-{
-}
-
-/**
- * garrow_io_readable_read:
- * @readable: A #GArrowIOReadable.
- * @n_bytes: The number of bytes to be read.
- * @n_read_bytes: (out): The read number of bytes.
- * @buffer: (array length=n_bytes): The buffer to be read data.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_io_readable_read(GArrowIOReadable *readable,
- gint64 n_bytes,
- gint64 *n_read_bytes,
- guint8 *buffer,
- GError **error)
-{
- const auto arrow_readable = garrow_io_readable_get_raw(readable);
-
- auto status = arrow_readable->Read(n_bytes, n_read_bytes, buffer);
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[io][readable][read]");
- return FALSE;
- }
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::Readable>
-garrow_io_readable_get_raw(GArrowIOReadable *readable)
-{
- auto *iface = GARROW_IO_READABLE_GET_IFACE(readable);
- return iface->get_raw(readable);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-readable.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-readable.h b/c_glib/arrow-glib/io-readable.h
deleted file mode 100644
index 279984b..0000000
--- a/c_glib/arrow-glib/io-readable.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_READABLE \
- (garrow_io_readable_get_type())
-#define GARROW_IO_READABLE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_READABLE, \
- GArrowIOReadable))
-#define GARROW_IO_IS_READABLE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_READABLE))
-#define GARROW_IO_READABLE_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_READABLE, \
- GArrowIOReadableInterface))
-
-typedef struct _GArrowIOReadable GArrowIOReadable;
-typedef struct _GArrowIOReadableInterface GArrowIOReadableInterface;
-
-GType garrow_io_readable_get_type(void) G_GNUC_CONST;
-
-gboolean garrow_io_readable_read(GArrowIOReadable *readable,
- gint64 n_bytes,
- gint64 *n_read_bytes,
- guint8 *buffer,
- GError **error);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-readable.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-readable.hpp b/c_glib/arrow-glib/io-readable.hpp
deleted file mode 100644
index 3d27b3f..0000000
--- a/c_glib/arrow-glib/io-readable.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-readable.h>
-
-/**
- * GArrowIOReadableInterface:
- *
- * It wraps `arrow::io::Readable`.
- */
-struct _GArrowIOReadableInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::Readable> (*get_raw)(GArrowIOReadable *file);
-};
-
-std::shared_ptr<arrow::io::Readable> garrow_io_readable_get_raw(GArrowIOReadable *readable);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-writeable-file.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-writeable-file.cpp b/c_glib/arrow-glib/io-writeable-file.cpp
deleted file mode 100644
index 41b682a..0000000
--- a/c_glib/arrow-glib/io-writeable-file.cpp
+++ /dev/null
@@ -1,84 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-writeable-file.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-writeable-file
- * @title: GArrowIOWriteableFile
- * @short_description: File output interface
- *
- * #GArrowIOWriteableFile is an interface for file output.
- */
-
-G_DEFINE_INTERFACE(GArrowIOWriteableFile,
- garrow_io_writeable_file,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_writeable_file_default_init (GArrowIOWriteableFileInterface *iface)
-{
-}
-
-/**
- * garrow_io_writeable_file_write_at:
- * @writeable_file: A #GArrowIOWriteableFile.
- * @position: The write start position.
- * @data: (array length=n_bytes): The data to be written.
- * @n_bytes: The number of bytes to be written.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_io_writeable_file_write_at(GArrowIOWriteableFile *writeable_file,
- gint64 position,
- const guint8 *data,
- gint64 n_bytes,
- GError **error)
-{
- const auto arrow_writeable_file =
- garrow_io_writeable_file_get_raw(writeable_file);
-
- auto status = arrow_writeable_file->WriteAt(position, data, n_bytes);
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[io][writeable-file][write-at]");
- return FALSE;
- }
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::WriteableFile>
-garrow_io_writeable_file_get_raw(GArrowIOWriteableFile *writeable_file)
-{
- auto *iface = GARROW_IO_WRITEABLE_FILE_GET_IFACE(writeable_file);
- return iface->get_raw(writeable_file);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-writeable-file.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-writeable-file.h b/c_glib/arrow-glib/io-writeable-file.h
deleted file mode 100644
index d1ebdbe..0000000
--- a/c_glib/arrow-glib/io-writeable-file.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_WRITEABLE_FILE \
- (garrow_io_writeable_file_get_type())
-#define GARROW_IO_WRITEABLE_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_WRITEABLE_FILE, \
- GArrowIOWriteableFile))
-#define GARROW_IO_IS_WRITEABLE_FILE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_WRITEABLE_FILE))
-#define GARROW_IO_WRITEABLE_FILE_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_WRITEABLE_FILE, \
- GArrowIOWriteableFileInterface))
-
-typedef struct _GArrowIOWriteableFile GArrowIOWriteableFile;
-typedef struct _GArrowIOWriteableFileInterface GArrowIOWriteableFileInterface;
-
-GType garrow_io_writeable_file_get_type(void) G_GNUC_CONST;
-
-gboolean garrow_io_writeable_file_write_at(GArrowIOWriteableFile *writeable_file,
- gint64 position,
- const guint8 *data,
- gint64 n_bytes,
- GError **error);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-writeable-file.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-writeable-file.hpp b/c_glib/arrow-glib/io-writeable-file.hpp
deleted file mode 100644
index aba95b2..0000000
--- a/c_glib/arrow-glib/io-writeable-file.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-writeable-file.h>
-
-/**
- * GArrowIOWriteableFile:
- *
- * It wraps `arrow::io::WriteableFile`.
- */
-struct _GArrowIOWriteableFileInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::WriteableFile> (*get_raw)(GArrowIOWriteableFile *file);
-};
-
-std::shared_ptr<arrow::io::WriteableFile> garrow_io_writeable_file_get_raw(GArrowIOWriteableFile *writeable_file);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-writeable.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-writeable.cpp b/c_glib/arrow-glib/io-writeable.cpp
deleted file mode 100644
index 9ea69e3..0000000
--- a/c_glib/arrow-glib/io-writeable.cpp
+++ /dev/null
@@ -1,106 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/io-writeable.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: io-writeable
- * @title: GArrowIOWriteable
- * @short_description: Output interface
- *
- * #GArrowIOWriteable is an interface for output. Output must be
- * writeable.
- */
-
-G_DEFINE_INTERFACE(GArrowIOWriteable,
- garrow_io_writeable,
- G_TYPE_OBJECT)
-
-static void
-garrow_io_writeable_default_init (GArrowIOWriteableInterface *iface)
-{
-}
-
-/**
- * garrow_io_writeable_write:
- * @writeable: A #GArrowIOWriteable.
- * @data: (array length=n_bytes): The data to be written.
- * @n_bytes: The number of bytes to be written.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_io_writeable_write(GArrowIOWriteable *writeable,
- const guint8 *data,
- gint64 n_bytes,
- GError **error)
-{
- const auto arrow_writeable = garrow_io_writeable_get_raw(writeable);
-
- auto status = arrow_writeable->Write(data, n_bytes);
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[io][writeable][write]");
- return FALSE;
- }
-}
-
-/**
- * garrow_io_writeable_flush:
- * @writeable: A #GArrowIOWriteable.
- * @error: (nullable): Return location for a #GError or %NULL.
- *
- * It ensures writing all data on memory to storage.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_io_writeable_flush(GArrowIOWriteable *writeable,
- GError **error)
-{
- const auto arrow_writeable = garrow_io_writeable_get_raw(writeable);
-
- auto status = arrow_writeable->Flush();
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[io][writeable][flush]");
- return FALSE;
- }
-}
-
-G_END_DECLS
-
-std::shared_ptr<arrow::io::Writeable>
-garrow_io_writeable_get_raw(GArrowIOWriteable *writeable)
-{
- auto *iface = GARROW_IO_WRITEABLE_GET_IFACE(writeable);
- return iface->get_raw(writeable);
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-writeable.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-writeable.h b/c_glib/arrow-glib/io-writeable.h
deleted file mode 100644
index ce23247..0000000
--- a/c_glib/arrow-glib/io-writeable.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <glib-object.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IO_TYPE_WRITEABLE \
- (garrow_io_writeable_get_type())
-#define GARROW_IO_WRITEABLE(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IO_TYPE_WRITEABLE, \
- GArrowIOWriteable))
-#define GARROW_IO_IS_WRITEABLE(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IO_TYPE_WRITEABLE))
-#define GARROW_IO_WRITEABLE_GET_IFACE(obj) \
- (G_TYPE_INSTANCE_GET_INTERFACE((obj), \
- GARROW_IO_TYPE_WRITEABLE, \
- GArrowIOWriteableInterface))
-
-typedef struct _GArrowIOWriteable GArrowIOWriteable;
-typedef struct _GArrowIOWriteableInterface GArrowIOWriteableInterface;
-
-GType garrow_io_writeable_get_type(void) G_GNUC_CONST;
-
-gboolean garrow_io_writeable_write(GArrowIOWriteable *writeable,
- const guint8 *data,
- gint64 n_bytes,
- GError **error);
-gboolean garrow_io_writeable_flush(GArrowIOWriteable *writeable,
- GError **error);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/io-writeable.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/io-writeable.hpp b/c_glib/arrow-glib/io-writeable.hpp
deleted file mode 100644
index f833924..0000000
--- a/c_glib/arrow-glib/io-writeable.hpp
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/io/interfaces.h>
-
-#include <arrow-glib/io-writeable.h>
-
-/**
- * GArrowIOWriteableInterface:
- *
- * It wraps `arrow::io::Writeable`.
- */
-struct _GArrowIOWriteableInterface
-{
- GTypeInterface parent_iface;
-
- std::shared_ptr<arrow::io::Writeable> (*get_raw)(GArrowIOWriteable *file);
-};
-
-std::shared_ptr<arrow::io::Writeable> garrow_io_writeable_get_raw(GArrowIOWriteable *writeable);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/ipc-file-reader.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/ipc-file-reader.cpp b/c_glib/arrow-glib/ipc-file-reader.cpp
deleted file mode 100644
index 223be85..0000000
--- a/c_glib/arrow-glib/ipc-file-reader.cpp
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/ipc/api.h>
-
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/record-batch.hpp>
-#include <arrow-glib/schema.hpp>
-
-#include <arrow-glib/io-random-access-file.hpp>
-
-#include <arrow-glib/ipc-file-reader.hpp>
-#include <arrow-glib/ipc-metadata-version.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: ipc-file-reader
- * @short_description: File reader class
- *
- * #GArrowIPCFileReader is a class for receiving data by file based IPC.
- */
-
-typedef struct GArrowIPCFileReaderPrivate_ {
- std::shared_ptr<arrow::ipc::FileReader> file_reader;
-} GArrowIPCFileReaderPrivate;
-
-enum {
- PROP_0,
- PROP_FILE_READER
-};
-
-G_DEFINE_TYPE_WITH_PRIVATE(GArrowIPCFileReader,
- garrow_ipc_file_reader,
- G_TYPE_OBJECT);
-
-#define GARROW_IPC_FILE_READER_GET_PRIVATE(obj) \
- (G_TYPE_INSTANCE_GET_PRIVATE((obj), \
- GARROW_IPC_TYPE_FILE_READER, \
- GArrowIPCFileReaderPrivate))
-
-static void
-garrow_ipc_file_reader_finalize(GObject *object)
-{
- GArrowIPCFileReaderPrivate *priv;
-
- priv = GARROW_IPC_FILE_READER_GET_PRIVATE(object);
-
- priv->file_reader = nullptr;
-
- G_OBJECT_CLASS(garrow_ipc_file_reader_parent_class)->finalize(object);
-}
-
-static void
-garrow_ipc_file_reader_set_property(GObject *object,
- guint prop_id,
- const GValue *value,
- GParamSpec *pspec)
-{
- GArrowIPCFileReaderPrivate *priv;
-
- priv = GARROW_IPC_FILE_READER_GET_PRIVATE(object);
-
- switch (prop_id) {
- case PROP_FILE_READER:
- priv->file_reader =
- *static_cast<std::shared_ptr<arrow::ipc::FileReader> *>(g_value_get_pointer(value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-
-static void
-garrow_ipc_file_reader_get_property(GObject *object,
- guint prop_id,
- GValue *value,
- GParamSpec *pspec)
-{
- switch (prop_id) {
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
- break;
- }
-}
-
-static void
-garrow_ipc_file_reader_init(GArrowIPCFileReader *object)
-{
-}
-
-static void
-garrow_ipc_file_reader_class_init(GArrowIPCFileReaderClass *klass)
-{
- GObjectClass *gobject_class;
- GParamSpec *spec;
-
- gobject_class = G_OBJECT_CLASS(klass);
-
- gobject_class->finalize = garrow_ipc_file_reader_finalize;
- gobject_class->set_property = garrow_ipc_file_reader_set_property;
- gobject_class->get_property = garrow_ipc_file_reader_get_property;
-
- spec = g_param_spec_pointer("file-reader",
- "ipc::FileReader",
- "The raw std::shared<arrow::ipc::FileReader> *",
- static_cast<GParamFlags>(G_PARAM_WRITABLE |
- G_PARAM_CONSTRUCT_ONLY));
- g_object_class_install_property(gobject_class, PROP_FILE_READER, spec);
-}
-
-/**
- * garrow_ipc_file_reader_open:
- * @file: The file to be read.
- * @error: (nullable): Return locatipcn for a #GError or %NULL.
- *
- * Returns: (nullable) (transfer full): A newly opened
- * #GArrowIPCFileReader or %NULL on error.
- */
-GArrowIPCFileReader *
-garrow_ipc_file_reader_open(GArrowIORandomAccessFile *file,
- GError **error)
-{
- std::shared_ptr<arrow::ipc::FileReader> arrow_file_reader;
- auto status =
- arrow::ipc::FileReader::Open(garrow_io_random_access_file_get_raw(file),
- &arrow_file_reader);
- if (status.ok()) {
- return garrow_ipc_file_reader_new_raw(&arrow_file_reader);
- } else {
- garrow_error_set(error, status, "[ipc][file-reader][open]");
- return NULL;
- }
-}
-
-/**
- * garrow_ipc_file_reader_get_schema:
- * @file_reader: A #GArrowIPCFileReader.
- *
- * Returns: (transfer full): The schema in the file.
- */
-GArrowSchema *
-garrow_ipc_file_reader_get_schema(GArrowIPCFileReader *file_reader)
-{
- auto arrow_file_reader =
- garrow_ipc_file_reader_get_raw(file_reader);
- auto arrow_schema = arrow_file_reader->schema();
- return garrow_schema_new_raw(&arrow_schema);
-}
-
-/**
- * garrow_ipc_file_reader_get_n_record_batches:
- * @file_reader: A #GArrowIPCFileReader.
- *
- * Returns: The number of record batches in the file.
- */
-guint
-garrow_ipc_file_reader_get_n_record_batches(GArrowIPCFileReader *file_reader)
-{
- auto arrow_file_reader =
- garrow_ipc_file_reader_get_raw(file_reader);
- return arrow_file_reader->num_record_batches();
-}
-
-/**
- * garrow_ipc_file_reader_get_version:
- * @file_reader: A #GArrowIPCFileReader.
- *
- * Returns: The format version in the file.
- */
-GArrowIPCMetadataVersion
-garrow_ipc_file_reader_get_version(GArrowIPCFileReader *file_reader)
-{
- auto arrow_file_reader =
- garrow_ipc_file_reader_get_raw(file_reader);
- auto arrow_version = arrow_file_reader->version();
- return garrow_ipc_metadata_version_from_raw(arrow_version);
-}
-
-/**
- * garrow_ipc_file_reader_get_record_batch:
- * @file_reader: A #GArrowIPCFileReader.
- * @i: The index of the target record batch.
- * @error: (nullable): Return locatipcn for a #GError or %NULL.
- *
- * Returns: (nullable) (transfer full):
- * The i-th record batch in the file or %NULL on error.
- */
-GArrowRecordBatch *
-garrow_ipc_file_reader_get_record_batch(GArrowIPCFileReader *file_reader,
- guint i,
- GError **error)
-{
- auto arrow_file_reader =
- garrow_ipc_file_reader_get_raw(file_reader);
- std::shared_ptr<arrow::RecordBatch> arrow_record_batch;
- auto status = arrow_file_reader->GetRecordBatch(i, &arrow_record_batch);
-
- if (status.ok()) {
- return garrow_record_batch_new_raw(&arrow_record_batch);
- } else {
- garrow_error_set(error, status, "[ipc][file-reader][get-record-batch]");
- return NULL;
- }
-}
-
-G_END_DECLS
-
-GArrowIPCFileReader *
-garrow_ipc_file_reader_new_raw(std::shared_ptr<arrow::ipc::FileReader> *arrow_file_reader)
-{
- auto file_reader =
- GARROW_IPC_FILE_READER(g_object_new(GARROW_IPC_TYPE_FILE_READER,
- "file-reader", arrow_file_reader,
- NULL));
- return file_reader;
-}
-
-std::shared_ptr<arrow::ipc::FileReader>
-garrow_ipc_file_reader_get_raw(GArrowIPCFileReader *file_reader)
-{
- GArrowIPCFileReaderPrivate *priv;
-
- priv = GARROW_IPC_FILE_READER_GET_PRIVATE(file_reader);
- return priv->file_reader;
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/ipc-file-reader.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/ipc-file-reader.h b/c_glib/arrow-glib/ipc-file-reader.h
deleted file mode 100644
index 15eba8e..0000000
--- a/c_glib/arrow-glib/ipc-file-reader.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow-glib/record-batch.h>
-#include <arrow-glib/schema.h>
-
-#include <arrow-glib/io-random-access-file.h>
-
-#include <arrow-glib/ipc-metadata-version.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IPC_TYPE_FILE_READER \
- (garrow_ipc_file_reader_get_type())
-#define GARROW_IPC_FILE_READER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IPC_TYPE_FILE_READER, \
- GArrowIPCFileReader))
-#define GARROW_IPC_FILE_READER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), \
- GARROW_IPC_TYPE_FILE_READER, \
- GArrowIPCFileReaderClass))
-#define GARROW_IPC_IS_FILE_READER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IPC_TYPE_FILE_READER))
-#define GARROW_IPC_IS_FILE_READER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), \
- GARROW_IPC_TYPE_FILE_READER))
-#define GARROW_IPC_FILE_READER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS((obj), \
- GARROW_IPC_TYPE_FILE_READER, \
- GArrowIPCFileReaderClass))
-
-typedef struct _GArrowIPCFileReader GArrowIPCFileReader;
-typedef struct _GArrowIPCFileReaderClass GArrowIPCFileReaderClass;
-
-/**
- * GArrowIPCFileReader:
- *
- * It wraps `arrow::ipc::FileReader`.
- */
-struct _GArrowIPCFileReader
-{
- /*< private >*/
- GObject parent_instance;
-};
-
-struct _GArrowIPCFileReaderClass
-{
- GObjectClass parent_class;
-};
-
-GType garrow_ipc_file_reader_get_type(void) G_GNUC_CONST;
-
-GArrowIPCFileReader *garrow_ipc_file_reader_open(GArrowIORandomAccessFile *file,
- GError **error);
-
-GArrowSchema *garrow_ipc_file_reader_get_schema(GArrowIPCFileReader *file_reader);
-guint garrow_ipc_file_reader_get_n_record_batches(GArrowIPCFileReader *file_reader);
-GArrowIPCMetadataVersion garrow_ipc_file_reader_get_version(GArrowIPCFileReader *file_reader);
-GArrowRecordBatch *garrow_ipc_file_reader_get_record_batch(GArrowIPCFileReader *file_reader,
- guint i,
- GError **error);
-
-G_END_DECLS
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/ipc-file-reader.hpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/ipc-file-reader.hpp b/c_glib/arrow-glib/ipc-file-reader.hpp
deleted file mode 100644
index 66cd45d..0000000
--- a/c_glib/arrow-glib/ipc-file-reader.hpp
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow/api.h>
-#include <arrow/ipc/api.h>
-
-#include <arrow-glib/ipc-file-reader.h>
-
-GArrowIPCFileReader *garrow_ipc_file_reader_new_raw(std::shared_ptr<arrow::ipc::FileReader> *arrow_file_reader);
-std::shared_ptr<arrow::ipc::FileReader> garrow_ipc_file_reader_get_raw(GArrowIPCFileReader *file_reader);
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/ipc-file-writer.cpp
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/ipc-file-writer.cpp b/c_glib/arrow-glib/ipc-file-writer.cpp
deleted file mode 100644
index d8b3c2e..0000000
--- a/c_glib/arrow-glib/ipc-file-writer.cpp
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#ifdef HAVE_CONFIG_H
-# include <config.h>
-#endif
-
-#include <arrow/ipc/api.h>
-
-#include <arrow-glib/array.hpp>
-#include <arrow-glib/error.hpp>
-#include <arrow-glib/record-batch.hpp>
-#include <arrow-glib/schema.hpp>
-
-#include <arrow-glib/io-output-stream.hpp>
-
-#include <arrow-glib/ipc-stream-writer.hpp>
-#include <arrow-glib/ipc-file-writer.hpp>
-
-G_BEGIN_DECLS
-
-/**
- * SECTION: ipc-file-writer
- * @short_description: File writer class
- *
- * #GArrowIPCFileWriter is a class for sending data by file based IPC.
- */
-
-G_DEFINE_TYPE(GArrowIPCFileWriter,
- garrow_ipc_file_writer,
- GARROW_IPC_TYPE_STREAM_WRITER);
-
-static void
-garrow_ipc_file_writer_init(GArrowIPCFileWriter *object)
-{
-}
-
-static void
-garrow_ipc_file_writer_class_init(GArrowIPCFileWriterClass *klass)
-{
-}
-
-/**
- * garrow_ipc_file_writer_open:
- * @sink: The output of the writer.
- * @schema: The schema of the writer.
- * @error: (nullable): Return locatipcn for a #GError or %NULL.
- *
- * Returns: (nullable) (transfer full): A newly opened
- * #GArrowIPCFileWriter or %NULL on error.
- */
-GArrowIPCFileWriter *
-garrow_ipc_file_writer_open(GArrowIOOutputStream *sink,
- GArrowSchema *schema,
- GError **error)
-{
- std::shared_ptr<arrow::ipc::FileWriter> arrow_file_writer;
- auto status =
- arrow::ipc::FileWriter::Open(garrow_io_output_stream_get_raw(sink).get(),
- garrow_schema_get_raw(schema),
- &arrow_file_writer);
- if (status.ok()) {
- return garrow_ipc_file_writer_new_raw(&arrow_file_writer);
- } else {
- garrow_error_set(error, status, "[ipc][file-writer][open]");
- return NULL;
- }
-}
-
-/**
- * garrow_ipc_file_writer_write_record_batch:
- * @file_writer: A #GArrowIPCFileWriter.
- * @record_batch: The record batch to be written.
- * @error: (nullable): Return locatipcn for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_ipc_file_writer_write_record_batch(GArrowIPCFileWriter *file_writer,
- GArrowRecordBatch *record_batch,
- GError **error)
-{
- auto arrow_file_writer =
- garrow_ipc_file_writer_get_raw(file_writer);
- auto arrow_record_batch =
- garrow_record_batch_get_raw(record_batch);
- auto arrow_record_batch_raw =
- arrow_record_batch.get();
-
- auto status = arrow_file_writer->WriteRecordBatch(*arrow_record_batch_raw);
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[ipc][file-writer][write-record-batch]");
- return FALSE;
- }
-}
-
-/**
- * garrow_ipc_file_writer_close:
- * @file_writer: A #GArrowIPCFileWriter.
- * @error: (nullable): Return locatipcn for a #GError or %NULL.
- *
- * Returns: %TRUE on success, %FALSE if there was an error.
- */
-gboolean
-garrow_ipc_file_writer_close(GArrowIPCFileWriter *file_writer,
- GError **error)
-{
- auto arrow_file_writer =
- garrow_ipc_file_writer_get_raw(file_writer);
-
- auto status = arrow_file_writer->Close();
- if (status.ok()) {
- return TRUE;
- } else {
- garrow_error_set(error, status, "[ipc][file-writer][close]");
- return FALSE;
- }
-}
-
-G_END_DECLS
-
-GArrowIPCFileWriter *
-garrow_ipc_file_writer_new_raw(std::shared_ptr<arrow::ipc::FileWriter> *arrow_file_writer)
-{
- auto file_writer =
- GARROW_IPC_FILE_WRITER(g_object_new(GARROW_IPC_TYPE_FILE_WRITER,
- "stream-writer", arrow_file_writer,
- NULL));
- return file_writer;
-}
-
-arrow::ipc::FileWriter *
-garrow_ipc_file_writer_get_raw(GArrowIPCFileWriter *file_writer)
-{
- auto arrow_stream_writer =
- garrow_ipc_stream_writer_get_raw(GARROW_IPC_STREAM_WRITER(file_writer));
- auto arrow_file_writer_raw =
- dynamic_cast<arrow::ipc::FileWriter *>(arrow_stream_writer.get());
- return arrow_file_writer_raw;
-}
http://git-wip-us.apache.org/repos/asf/arrow/blob/6443b828/c_glib/arrow-glib/ipc-file-writer.h
----------------------------------------------------------------------
diff --git a/c_glib/arrow-glib/ipc-file-writer.h b/c_glib/arrow-glib/ipc-file-writer.h
deleted file mode 100644
index 732d942..0000000
--- a/c_glib/arrow-glib/ipc-file-writer.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-#pragma once
-
-#include <arrow-glib/ipc-stream-writer.h>
-
-G_BEGIN_DECLS
-
-#define GARROW_IPC_TYPE_FILE_WRITER \
- (garrow_ipc_file_writer_get_type())
-#define GARROW_IPC_FILE_WRITER(obj) \
- (G_TYPE_CHECK_INSTANCE_CAST((obj), \
- GARROW_IPC_TYPE_FILE_WRITER, \
- GArrowIPCFileWriter))
-#define GARROW_IPC_FILE_WRITER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_CAST((klass), \
- GARROW_IPC_TYPE_FILE_WRITER, \
- GArrowIPCFileWriterClass))
-#define GARROW_IPC_IS_FILE_WRITER(obj) \
- (G_TYPE_CHECK_INSTANCE_TYPE((obj), \
- GARROW_IPC_TYPE_FILE_WRITER))
-#define GARROW_IPC_IS_FILE_WRITER_CLASS(klass) \
- (G_TYPE_CHECK_CLASS_TYPE((klass), \
- GARROW_IPC_TYPE_FILE_WRITER))
-#define GARROW_IPC_FILE_WRITER_GET_CLASS(obj) \
- (G_TYPE_INSTANCE_GET_CLASS((obj), \
- GARROW_IPC_TYPE_FILE_WRITER, \
- GArrowIPCFileWriterClass))
-
-typedef struct _GArrowIPCFileWriter GArrowIPCFileWriter;
-typedef struct _GArrowIPCFileWriterClass GArrowIPCFileWriterClass;
-
-/**
- * GArrowIPCFileWriter:
- *
- * It wraps `arrow::ipc::FileWriter`.
- */
-struct _GArrowIPCFileWriter
-{
- /*< private >*/
- GArrowIPCStreamWriter parent_instance;
-};
-
-struct _GArrowIPCFileWriterClass
-{
- GObjectClass parent_class;
-};
-
-GType garrow_ipc_file_writer_get_type(void) G_GNUC_CONST;
-
-GArrowIPCFileWriter *garrow_ipc_file_writer_open(GArrowIOOutputStream *sink,
- GArrowSchema *schema,
- GError **error);
-
-gboolean garrow_ipc_file_writer_write_record_batch(GArrowIPCFileWriter *file_writer,
- GArrowRecordBatch *record_batch,
- GError **error);
-gboolean garrow_ipc_file_writer_close(GArrowIPCFileWriter *file_writer,
- GError **error);
-
-G_END_DECLS