Skip to content

Commit

Permalink
Merge pull request #9 from TileDB-Inc/dev
Browse files Browse the repository at this point in the history
Release 0.6.0
  • Loading branch information
stavrospapadopoulos authored May 18, 2017
2 parents 2d1fe95 + 088f10c commit 2d6ce9d
Show file tree
Hide file tree
Showing 27 changed files with 3,274 additions and 963 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
*.swp
build/*
core/bin/*
core/obj/*
core/lib/*
Expand Down
6 changes: 4 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ env:
install:
# Install cmake, lcov, MPICH
- sudo apt-get -y install cmake lcov mpich
# Install zlib, OpenSSL, Gtest and LZ4
- sudo apt-get -y install zlib1g-dev libssl-dev libgtest-dev liblz4-dev
# Install zlib, bzip2 and LZ4
- sudo apt-get -y install zlib1g-dev libbz2-dev liblz4-dev
# Install OpenSSL and Gtest
- sudo apt-get -y install libssl-dev libgtest-dev
# Install Zstandard
- wget https://github.com/facebook/zstd/archive/v1.0.0.tar.gz
- tar xf v1.0.0.tar.gz
Expand Down
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ set(TILEDB_LIB_DEPENDENCIES ${TILEDB_LIB_DEPENDENCIES} ${ZSTD_LIBRARIES})
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
set(TILEDB_LIB_DEPENDENCIES ${TILEDB_LIB_DEPENDENCIES} ${OPENSSL_LIBRARIES})
find_package(Bzip2 REQUIRED)
include_directories(${BZIP2_INCLUDE_DIR})
set(TILEDB_LIB_DEPENDENCIES ${TILEDB_LIB_DEPENDENCIES} ${BZIP2_LIBRARIES})

# Find optional library dependencies
find_package(GTest)
Expand Down
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# TileDB

[![Travis](https://img.shields.io/travis/Intel-HLS/TileDB.svg?maxAge=2592000)]
(https://travis-ci.org/Intel-HLS/TileDB)
[![Travis](https://travis-ci.org/TileDB-Inc/TileDB.svg?branch=master)](https://travis-ci.org/TileDB-Inc/TileDB)

The installation guide for TileDB can be found at this [Github
Wiki](https://github.com/Intel-HLS/TileDB/wiki).
Wiki](https://github.com/TileDB-Inc/TileDB/wiki).

The TileDB C API documentation and tutorials can be
found at the [TileDB official website](http://istc-bigdata.org/tiledb).
found at the [TileDB official website](http://www.tiledb.org).
64 changes: 64 additions & 0 deletions cmake/Modules/FindBzip2.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
#
# FindBzip2.cmake
#
#
# The MIT License
#
# Copyright (c) 2016 MIT and Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
# Finds the Bzip2 library. This module defines:
# - BZIP2_INCLUDE_DIR, directory containing headers
# - BZIP2_LIBRARIES, the Bzip2 library path
# - BZIP2_FOUND, whether Bzip2 has been found

# Find header files
if(BZIP2_SEARCH_HEADER_PATHS)
find_path(
BZIP2_INCLUDE_DIR bzip2.h
PATHS ${BZIP2_SEARCH_HEADER_PATHS}
NO_DEFAULT_PATH
)
else()
find_path(BZIP2_INCLUDE_DIR bzlib.h)
endif()

# Find library
if(BZIP2_SEARCH_LIB_PATH)
find_library(
BZIP2_LIBRARIES NAMES bz2
PATHS ${BZIP2_SEARCH_LIB_PATH}$
NO_DEFAULT_PATH
)
else()
find_library(BZIP2_LIBRARIES NAMES bz2)
endif()

if(BZIP2_INCLUDE_DIR AND BZIP2_LIBRARIES)
message(STATUS "Found Bzip2: ${BZIP2_LIBRARIES}")
set(BZIP2_FOUND TRUE)
else()
set(BZIP2_FOUND FALSE)
endif()

if(BZIP2_FIND_REQUIRED AND NOT BZIP2_FOUND)
message(FATAL_ERROR "Could not find the Bzip2 library.")
endif()

58 changes: 26 additions & 32 deletions core/include/array/array_schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@

#include "array_schema_c.h"
#include "metadata_schema_c.h"
#include "hilbert_curve.h"
#include <limits>
#include <string>
#include <typeinfo>
Expand Down Expand Up @@ -416,7 +415,6 @@ class ArraySchema {
* Sets the tile order. Supported tile orders.
* - TILEDB_ROW_MAJOR
* - TILEDB_COL_MAJOR
* - TILEDB_HILBSERT
*
* @param tile_order The tile order.
* @return TILEDB_AS_OK for success, and TILEDB_AS_ERR for error.
Expand All @@ -432,12 +430,24 @@ class ArraySchema {
* - TILEDB_INT64
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*
* The supported types for the coordinates are:
* - TILEDB_INT32
* - TILEDB_INT64
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*
* @param types The types.
* @return TILEDB_AS_OK for success, and TILEDB_AS_ERR for error.
Expand Down Expand Up @@ -609,16 +619,6 @@ class ArraySchema {
template<class T>
void get_tile_subarray(const T* tile_coords, T* tile_subarray) const;

/**
* Returns the Hilbert id of the input coordinates.
*
* @tparam T The coordinates type.
* @param coords The coordinates for which the Hilbert id is computed.
* @return The computed Hilbert id.
*/
template<class T>
int64_t hilbert_id(const T* coords) const;

/**
* Checks the order of the input coordinates. First the tile order is checked
* (which, in case of non-regular tiles, is always the same), breaking the
Expand Down Expand Up @@ -695,7 +695,6 @@ class ArraySchema {
* The cell order. It can be one of the following:
* - TILEDB_ROW_MAJOR
* - TILEDB_COL_MAJOR
* - TILEDB_HILBERT.
*/
int cell_order_;
/** Stores the size of every attribute (plus coordinates in the end). */
Expand All @@ -721,10 +720,9 @@ class ArraySchema {
* - TILEDB_BLOSC_ZLIB
* - TILEDB_BLOSC_ZSTD
* - TILEDB_RLE
* - TILEDB_BZIP2
*/
std::vector<int> compression_;
/** Auxiliary variable used when calculating Hilbert ids. */
int* coords_for_hilbert_;
/** The size (in bytes) of the coordinates. */
size_t coords_size_;
/**
Expand All @@ -742,13 +740,6 @@ class ArraySchema {
* type.
*/
void* domain_;
/**
* Number of bits used for the calculation of cell ids with the
* Hilbert curve.
*/
int hilbert_bits_;
/** A Hilbert curve object for finding cell ids. */
HilbertCurve* hilbert_curve_;
/**
* The array domain. It should contain one [lower, upper] pair per dimension.
* The type of the values stored in this buffer should match the coordinates
Expand All @@ -775,7 +766,7 @@ class ArraySchema {
/**
* The tile order. It can be one of the following:
* - TILEDB_ROW_MAJOR
* - TILEDB_COL_MAJOR.
* - TILEDB_COL_MAJOR
*/
int tile_order_;
/**
Expand All @@ -786,12 +777,24 @@ class ArraySchema {
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_CHAR
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*
* The coordinate type can be one of the following:
* - TILEDB_INT32
* - TILEDB_INT64
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*/
std::vector<int> types_;
/** Stores the size of every attribute type (plus coordinates in the end). */
Expand Down Expand Up @@ -831,15 +834,6 @@ class ArraySchema {
/** Computes and returns the size of an attribute (or coordinates). */
size_t compute_cell_size(int attribute_id) const;

/**
* Computes the number of bits per dimension required by the Hilbert curve.
*
* @tparam T The domain type.
* @return void
*/
template<class T>
void compute_hilbert_bits();

/**
* Computes the tile domain. Applicable only to arrays with regular tiles.
*
Expand Down
14 changes: 13 additions & 1 deletion core/include/array/array_schema_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ typedef struct ArraySchemaC {
* The cell order. It can be one of the following:
* - TILEDB_ROW_MAJOR
* - TILEDB_COL_MAJOR
* - TILEDB_HILBERT.
*/
int cell_order_;
/**
Expand All @@ -79,6 +78,7 @@ typedef struct ArraySchemaC {
* - TILEDB_BLOSC_ZLIB
* - TILEDB_BLOSC_ZSTD
* - TILEDB_RLE
* - TILEDB_BZIP2
*/
int* compression_;
/**
Expand Down Expand Up @@ -117,12 +117,24 @@ typedef struct ArraySchemaC {
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_CHAR
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*
* The coordinate type can be one of the following:
* - TILEDB_INT32
* - TILEDB_INT64
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*/
int* types_;
} ArraySchemaC;
Expand Down
4 changes: 2 additions & 2 deletions core/include/array/array_sorted_write_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ class ArraySortedWriteState {

/**
* Fills the **a single** cell in a variable-sized buffer of the current copy
* tile slab with the input id with an empty value, based on the template t
* ype. Applicable only to variable-sized attributes.
* tile slab with the input id with an empty value, based on the template
* type. Applicable only to variable-sized attributes.
*
* @tparam T The attribute type.
* @param bid The buffer id corresponding to the targeted attribute.
Expand Down
39 changes: 37 additions & 2 deletions core/include/c_api/tiledb.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,6 @@ typedef struct TileDB_ArraySchema {
* The cell order. It can be one of the following:
* - TILEDB_ROW_MAJOR
* - TILEDB_COL_MAJOR
* - TILEDB_HILBERT.
*/
int cell_order_;
/**
Expand All @@ -246,6 +245,7 @@ typedef struct TileDB_ArraySchema {
* - TILEDB_BLOSC_ZLIB
* - TILEDB_BLOSC_ZSTD
* - TILEDB_RLE
* - TILEDB_BZIP2
*
* If it is *NULL*, then the default TILEDB_NO_COMPRESSION is used for all
* attributes.
Expand Down Expand Up @@ -286,12 +286,24 @@ typedef struct TileDB_ArraySchema {
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_CHAR
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*
* The coordinate type can be one of the following:
* - TILEDB_INT32
* - TILEDB_INT64
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*/
int* types_;
} TileDB_ArraySchema;
Expand Down Expand Up @@ -759,6 +771,7 @@ typedef struct TileDB_MetadataSchema {
* - TILEDB_BLOSC_ZLIB
* - TILEDB_BLOSC_ZSTD
* - TILEDB_RLE
* - TILEDB_BZIP2
*
* If it is *NULL*, then the default TILEDB_NO_COMPRESSION is used for all
* attributes.
Expand All @@ -771,7 +784,13 @@ typedef struct TileDB_MetadataSchema {
* - TILEDB_INT64
* - TILEDB_FLOAT32
* - TILEDB_FLOAT64
* - TILEDB_CHAR.
* - TILEDB_CHAR
* - TILEDB_INT8
* - TILEDB_UINT8
* - TILEDB_INT16
* - TILEDB_UINT16
* - TILEDB_UINT32
* - TILEDB_UINT64
*/
int* types_;
} TileDB_MetadataSchema;
Expand Down Expand Up @@ -1084,6 +1103,22 @@ TILEDB_EXPORT int tiledb_metadata_iterator_finalize(
/* DIRECTORY MANAGEMENT */
/* ********************************* */

/**
* Returns the type of the input directory.
*
* @param tiledb_ctx The TileDB context.
* @param dir The input directory.
* @return It can be one of the following:
* - TILEDB_WORKSPACE
* - TILEDB_GROUP
* - TILEDB_ARRAY
* - TILEDB_METADATA
* - -1 (none of the above)
*/
TILEDB_EXPORT int tiledb_dir_type(
const TileDB_CTX* tiledb_ctx,
const char* dir);

/**
* Clears a TileDB directory. The corresponding TileDB object (workspace,
* group, array, or metadata) will still exist after the execution of the
Expand Down
Loading

0 comments on commit 2d6ce9d

Please sign in to comment.