-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARROW-222: Prototyping an IO interface for Arrow, with initial HDFS t…
…arget - Switch Travis CI back to Ubuntu trusty (old Boost in precise has issues with C++11) - Adapt SFrame libhdfs shim for arrow - Create C++ public API within arrow:io to libhdfs - Implement and test many functions in libhdfs - Start Cython wrapper interface to arrow_io. Begin Python file-like interface, unit tests - Add thirdparty hdfs.h so builds are possible without a local Hadoop distro (e.g. in Travis CI). Change-Id: I4a46e50f6c1c22787baa3749d8a542216341e630
- Loading branch information
Showing
26 changed files
with
3,656 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
Apache Arrow | ||
Copyright 2016 The Apache Software Foundation | ||
|
||
This product includes software developed at | ||
The Apache Software Foundation (http://www.apache.org/). | ||
|
||
This product includes software from the SFrame project (BSD, 3-clause). | ||
* Copyright (C) 2015 Dato, Inc. | ||
* Copyright (c) 2009 Carnegie Mellon University. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## Using Arrow's HDFS (Apache Hadoop Distributed File System) interface | ||
|
||
### Build requirements | ||
|
||
To build the integration, pass the following option to CMake | ||
|
||
```shell | ||
-DARROW_HDFS=on | ||
``` | ||
|
||
For convenience, we have bundled `hdfs.h` for libhdfs from Apache Hadoop in | ||
Arrow's thirdparty. If you wish to build against the `hdfs.h` in your installed | ||
Hadoop distribution, set the `$HADOOP_HOME` environment variable. | ||
|
||
### Runtime requirements | ||
|
||
By default, the HDFS client C++ class in `libarrow_io` uses the libhdfs JNI | ||
interface to the Java Hadoop client. This library is loaded **at runtime** | ||
(rather than at link / library load time, since the library may not be in your | ||
LD_LIBRARY_PATH), and relies on some environment variables. | ||
|
||
* `HADOOP_HOME`: the root of your installed Hadoop distribution. Check in the | ||
`lib/native` directory to look for `libhdfs.so` if you have any questions | ||
about which directory you're after. | ||
* `JAVA_HOME`: the location of your Java SDK installation | ||
* `CLASSPATH`: must contain the Hadoop jars. You can set these using: | ||
|
||
```shell | ||
export CLASSPATH=`$HADOOP_HOME/bin/hadoop classpath --glob` | ||
``` | ||
|
||
#### Setting $JAVA_HOME automatically on OS X | ||
|
||
The installed location of Java on OS X can vary, however the following snippet | ||
will set it automatically for you: | ||
|
||
```shell | ||
export JAVA_HOME=$(/usr/libexec/java_home) | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# 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. | ||
|
||
# ---------------------------------------------------------------------- | ||
# arrow_io : Arrow IO interfaces | ||
|
||
set(ARROW_IO_LINK_LIBS | ||
arrow | ||
) | ||
|
||
set(ARROW_IO_PRIVATE_LINK_LIBS | ||
boost_system | ||
boost_filesystem | ||
) | ||
|
||
set(ARROW_IO_TEST_LINK_LIBS | ||
arrow_io | ||
${ARROW_IO_PRIVATE_LINK_LIBS}) | ||
|
||
set(ARROW_IO_SRCS | ||
) | ||
|
||
if(ARROW_HDFS) | ||
if(NOT THIRDPARTY_DIR) | ||
message(FATAL_ERROR "THIRDPARTY_DIR not set") | ||
endif() | ||
|
||
if (DEFINED ENV{HADOOP_HOME}) | ||
set(HADOOP_HOME $ENV{HADOOP_HOME}) | ||
else() | ||
set(HADOOP_HOME "${THIRDPARTY_DIR}/hadoop") | ||
endif() | ||
|
||
set(HDFS_H_PATH "${HADOOP_HOME}/include/hdfs.h") | ||
if (NOT EXISTS ${HDFS_H_PATH}) | ||
message(FATAL_ERROR "Did not find hdfs.h at ${HDFS_H_PATH}") | ||
endif() | ||
message(STATUS "Found hdfs.h at: " ${HDFS_H_PATH}) | ||
message(STATUS "Building libhdfs shim component") | ||
|
||
include_directories(SYSTEM "${HADOOP_HOME}/include") | ||
|
||
set(ARROW_HDFS_SRCS | ||
hdfs.cc | ||
libhdfs_shim.cc) | ||
|
||
set_property(SOURCE ${ARROW_HDFS_SRCS} | ||
APPEND_STRING PROPERTY | ||
COMPILE_FLAGS "-DHAS_HADOOP") | ||
|
||
set(ARROW_IO_SRCS | ||
${ARROW_HDFS_SRCS} | ||
${ARROW_IO_SRCS}) | ||
|
||
ADD_ARROW_TEST(hdfs-io-test) | ||
ARROW_TEST_LINK_LIBRARIES(hdfs-io-test | ||
${ARROW_IO_TEST_LINK_LIBS}) | ||
endif() | ||
|
||
add_library(arrow_io SHARED | ||
${ARROW_IO_SRCS} | ||
) | ||
target_link_libraries(arrow_io LINK_PUBLIC ${ARROW_IO_LINK_LIBS}) | ||
target_link_libraries(arrow_io LINK_PRIVATE ${ARROW_IO_PRIVATE_LINK_LIBS}) | ||
|
||
SET_TARGET_PROPERTIES(arrow_io PROPERTIES LINKER_LANGUAGE CXX) | ||
|
||
if (APPLE) | ||
set_target_properties(arrow_io | ||
PROPERTIES | ||
BUILD_WITH_INSTALL_RPATH ON | ||
INSTALL_NAME_DIR "@rpath") | ||
endif() | ||
|
||
# Headers: top level | ||
install(FILES | ||
hdfs.h | ||
interfaces.h | ||
DESTINATION include/arrow/io) | ||
|
||
install(TARGETS arrow_io | ||
LIBRARY DESTINATION lib | ||
ARCHIVE DESTINATION lib) |
Oops, something went wrong.