Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ endif

needs_benchmarks = get_option('benchmarks')
needs_csv = get_option('csv')
needs_filesystem = false
needs_hdfs = get_option('hdfs')
needs_filesystem = false or needs_hdfs
needs_integration = false
needs_tests = get_option('tests')
needs_ipc = get_option('ipc') or needs_tests or needs_benchmarks
Expand Down
7 changes: 7 additions & 0 deletions cpp/meson.options
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@ option(
value: false,
)

option(
'hdfs',
type: 'boolean',
description: 'Build the Arrow HDFS bridge',
value: false,
)

option(
'ipc',
type: 'boolean',
Expand Down
76 changes: 76 additions & 0 deletions cpp/src/arrow/io/meson.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# 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.

io_tests = ['buffered_test', 'compressed_test', 'file_test', 'memory_test']

foreach io_test : io_tests
test_name = 'arrow-io-@0@'.format(io_test.replace('_', '-'))
exc = executable(
test_name,
sources: '@0@.cc'.format(io_test),
dependencies: [arrow_test_dep],
implicit_include_directories: false,
)
test(test_name, exc)
endforeach

if needs_hdfs
hdfs_incdir = '../../../thirdparty/hadoop/include'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From a purity perspective I think it would be better if we used hdfs as a subproject, and could create a dependency for it. However, I wouldn't find the original source for the file thirdparty/hadoop/include/hdfs.h

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Does there happen to be a canonical link to download just the hadoop-hdfs-native-client?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure that there is a way with the wrapdb to natively extract just the file we need from a collection of projects like that without a top level CMakeLists.txt or meson.build configuration. I'll have to research that further if its a blocker here

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is a blocker.
We can keep using the vendored hdfs.h.

We loads libhdfs.so manually by dlload() not compile time -lhdfs. So we just need hdfs.h. If hdfs.h has many backward incompatible changes, we may want to use upstream hdfs.h. But it's very stable so far. So we can keep using the vendored hdfs.h.

exc = executable(
'arrow-io-hdfs-test',
sources: 'hdfs_test.cc',
dependencies: [arrow_test_dep, filesystem_dep],
implicit_include_directories: false,
include_directories: [hdfs_incdir],
)
test('arrow-io-hdfs-test', exc)
endif

io_benchmarks = ['file_benchmark', 'compressed_benchmark']

foreach io_benchmark : io_benchmarks
benchmark_name = 'arrow-io-@0@'.format(io_benchmark.replace('_', '-'))
exc = executable(
benchmark_name,
sources: '@0@.cc'.format(io_benchmark),
dependencies: [arrow_test_dep, benchmark_dep],
implicit_include_directories: false,
)
benchmark(benchmark_name, exc)
endforeach

# TODO: Add memory benchmark with SIMD. See GH-45823

install_headers(
[
'api.h',
'buffered.h',
'caching.h',
'compressed.h',
'concurrency.h',
'file.h',
'hdfs.h',
'interfaces.h',
'memory.h',
'mman.h',
'slow.h',
'stdio.h',
'transform.h',
'type_fwd.h',
],
subdir: 'arrow/io',
)
3 changes: 2 additions & 1 deletion cpp/src/arrow/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,7 @@ install_headers(
'visit_scalar_inline.h',
'visit_type_inline.h',
],
install_dir: 'arrow',
subdir: 'arrow',
)

if needs_testing
Expand Down Expand Up @@ -531,6 +531,7 @@ pkg.generate(
subdir('testing')

subdir('c')
subdir('io')
subdir('util')

if needs_csv
Expand Down
1 change: 1 addition & 0 deletions cpp/src/arrow/testing/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ install_headers(
'util.h',
'visibility.h',
],
subdir: 'arrow/testing',
)

if needs_tests
Expand Down