Skip to content

Commit

Permalink
PARQUET-482: Organize public API headers
Browse files Browse the repository at this point in the history
Feedback requested. I'll add some simple Markdown documentation for the public API if we agree on the general approach.

Author: Wes McKinney <wesm@apache.org>

Closes apache#70 from wesm/PARQUET-482 and squashes the following commits:

60230ea [Wes McKinney] Organize public API headers in parquet/api. Remove unneeded dict-encoding.h and parquet/parquet.h

Change-Id: I1a049c20da19e2210aeebb430d54cad6c18e4bfb
  • Loading branch information
wesm authored and julienledem committed Mar 2, 2016
1 parent 4bcfb0e commit 8d43015
Show file tree
Hide file tree
Showing 9 changed files with 68 additions and 43 deletions.
1 change: 0 additions & 1 deletion cpp/src/parquet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

# Headers: top level
install(FILES
parquet.h
exception.h
types.h
DESTINATION include/parquet)
Expand Down
23 changes: 23 additions & 0 deletions cpp/src/parquet/api/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# 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.

# Headers: public api
install(FILES
io.h
reader.h
schema.h
DESTINATION include/parquet/api)
24 changes: 7 additions & 17 deletions cpp/src/parquet/util/dict-encoding.h → cpp/src/parquet/api/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,12 @@
// specific language governing permissions and limitations
// under the License.

#ifndef PARQUET_UTIL_DICT_ENCODING_H
#define PARQUET_UTIL_DICT_ENCODING_H
#ifndef PARQUET_API_IO_H
#define PARQUET_API_IO_H

#include <algorithm>
#include <cstdint>
#include <limits>
#include <vector>
#include "parquet/exception.h"
#include "parquet/util/buffer.h"
#include "parquet/util/input.h"
#include "parquet/util/output.h"

#include "parquet/types.h"
#include "parquet/encodings/plain-encoding.h"
#include "parquet/util/hash-util.h"
#include "parquet/util/mem-pool.h"
#include "parquet/util/rle-encoding.h"

namespace parquet_cpp {

} // namespace parquet_cpp

#endif // PARQUET_UTIL_DICT_ENCODING_H
#endif // PARQUET_API_IO_H
26 changes: 6 additions & 20 deletions cpp/src/parquet/parquet.h → cpp/src/parquet/api/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,18 @@
// specific language governing permissions and limitations
// under the License.

#ifndef PARQUET_PARQUET_H
#define PARQUET_PARQUET_H

#include <exception>
#include <cstdint>
#include <cstring>
#include <memory>
#include <string>
#include <unordered_map>
#include <vector>

#include "parquet/exception.h"
#ifndef PARQUET_API_READER_H
#define PARQUET_API_READER_H

// Column reader API
#include "parquet/column/reader.h"

// File API
#include "parquet/exception.h"
#include "parquet/file/reader.h"

// Schemas
#include "parquet/schema/descriptor.h"
#include "parquet/schema/printer.h"
#include "parquet/schema/types.h"
#include "parquet/api/schema.h"

// IO
#include "parquet/util/input.h"
#include "parquet/util/output.h"
#include "parquet/api/io.h"

#endif
#endif // PARQUET_API_READER_H
26 changes: 26 additions & 0 deletions cpp/src/parquet/api/schema.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// 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.

#ifndef PARQUET_API_SCHEMA_H
#define PARQUET_API_SCHEMA_H

// Schemas
#include "parquet/schema/descriptor.h"
#include "parquet/schema/printer.h"
#include "parquet/schema/types.h"

#endif // PARQUET_API_SCHEMA_H
1 change: 0 additions & 1 deletion cpp/src/parquet/encodings/dictionary-encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#include "parquet/encodings/encoder.h"
#include "parquet/encodings/plain-encoding.h"
#include "parquet/util/cpu-info.h"
#include "parquet/util/dict-encoding.h"
#include "parquet/util/hash-util.h"
#include "parquet/util/mem-pool.h"
#include "parquet/util/rle-encoding.h"
Expand Down
1 change: 0 additions & 1 deletion cpp/src/parquet/encodings/encoding-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@
#include "parquet/schema/types.h"
#include "parquet/util/bit-util.h"
#include "parquet/util/buffer.h"
#include "parquet/util/dict-encoding.h"
#include "parquet/util/output.h"
#include "parquet/util/test-common.h"

Expand Down
5 changes: 4 additions & 1 deletion cpp/src/parquet/public-api-test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
// under the License.

#include <gtest/gtest.h>
#include "parquet/parquet.h"

#include "parquet/api/io.h"
#include "parquet/api/reader.h"
#include "parquet/api/schema.h"

namespace parquet_cpp {

Expand Down
4 changes: 2 additions & 2 deletions cpp/src/parquet/util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ install(FILES
bit-stream-utils.h
bit-stream-utils.inline.h
bit-util.h
buffer.h
buffer-builder.h
compiler-util.h
cpu-info.h
dict-encoding.h
hash-util.h
input.h
logging.h
Expand All @@ -32,7 +32,7 @@ install(FILES
output.h
rle-encoding.h
stopwatch.h
sse-info.h
sse-util.h
DESTINATION include/parquet/util)

add_library(parquet_util STATIC
Expand Down

0 comments on commit 8d43015

Please sign in to comment.