Classes | Macros | Typedefs | Functions
const.h File Reference

Defines common data types, constants and macros. More...

#include <errno.h>
#include <string.h>
#include <pthread.h>
#include "fastbit-config.h"
#include <sys/types.h>
#include <stdint.h>
#include <syslimits.h>
#include <strings.h>

Go to the source code of this file.

Classes

struct  _rwlock
 

Macros

#define _ISOC90_SOURCE
 
#define _PTHREADS
 
#define _REENTRANT
 
#define FASTBIT_CXX_DLLSPEC
 
#define FASTBIT_DIRSEP   '/'
 
#define IBIS_REPLACEMENT_RWLOCK
 
#define MAX_LINE   2048
 
#define MessageBox(x1, x2, x3, x4)   ; {}
 
#define PATH_MAX   512
 
#define PREFERRED_BLOCK_SIZE   1048576
 PREFERRED_BLOCK_SIZE is the parameter used to determine the logical page size during some I/O intensive operations, such as nested loop join. More...
 
#define stricmp   strcasecmp
 
#define strnicmp   strncasecmp
 
#define THREAD_RWLOCK_INITIALIZER
 

Typedefs

typedef int(* FastBitReadBitmaps) (void *context, uint64_t start, uint64_t count, uint32_t *data)
 A function prototype for delayed index reconstruction. More...
 
typedef int(* FastBitReadExtArray) (void *context, uint64_t nd, uint64_t *starts, uint64_t *counts, void *data)
 A function prototype for reading a portion of an external array. More...
 
typedef struct _rwlock pthread_rwlock_t
 

Functions

int pthread_rwlock_destroy (pthread_rwlock_t *rwlock)
 
int pthread_rwlock_init (pthread_rwlock_t *rwlock, void *)
 
int pthread_rwlock_rdlock (pthread_rwlock_t *rwlock)
 
int pthread_rwlock_tryrdlock (pthread_rwlock_t *rwlock)
 
int pthread_rwlock_trywrlock (pthread_rwlock_t *rwlock)
 
int pthread_rwlock_unlock (pthread_rwlock_t *rwlock)
 
int pthread_rwlock_wrlock (pthread_rwlock_t *rwlock)
 

Detailed Description

Defines common data types, constants and macros.

Used by all files in the IBIS implementation of FastBit from the Scientific Data Management Research Group of Lawrence Berkeley National Laboratory.

Macro Definition Documentation

#define PREFERRED_BLOCK_SIZE   1048576

PREFERRED_BLOCK_SIZE is the parameter used to determine the logical page size during some I/O intensive operations, such as nested loop join.

Many CPUs have 512KB cache, setting this value to 256K (262144) will allow about two such 'logical' block to be in cache at the same time, which should be good to things like nested loop join.

Referenced by ibis::query::orderPairs(), ibis::part::reorderValues(), and ibis::part::writeValues().

#define THREAD_RWLOCK_INITIALIZER
Value:
{PTHREAD_MUTEX_INITIALIZER, PTHREAD_COND_INITIALIZER, \
PTHREAD_COND_INITIALIZER, 0, 0}

Typedef Documentation

typedef int(* FastBitReadBitmaps) (void *context, uint64_t start, uint64_t count, uint32_t *data)

A function prototype for delayed index reconstruction.

This function is used to read a portion of a 1-D array of 32-bit unsigned integers. It is meant to read bitmaps while answering queries, where the bitmaps have been serialized and packed together using a concrete versin of ibis::index::write.

  • context: an opaque pointer used to stored the context information for the source array.
  • start: assume the source is a simple 1-D uint32_t array, this is the position (starting from 0) of the first element to be read. This is also known as the offset.
  • count: the number of elements to be read. Following C/C++ convention, this points to the elment just beyond the values to be read.
  • data: the pointer to the output buffer for holding the values read into memory.
Returns
>= 0 to indicate success, < 0 to indicate error.
Note
This was previously named FastBitReadIntArray, which was meant to say "integer array." Since the introduction of FastBitReadExtArray, the prefix "Int" could be misinterpreted as "internal" in contrast with "Ext" for "External."
typedef int(* FastBitReadExtArray) (void *context, uint64_t nd, uint64_t *starts, uint64_t *counts, void *data)

A function prototype for reading a portion of an external array.

The user data is viwed as a numti-dimensional array. This function is to read a part of the array. All values read by this function are packed together in row-major ordering, which is the typical C/C++ array ordering.

  • context: an opaque pointer used to stored the context information for the source data. This argument came from the user and is given back to the user without ever been updated or modified.
  • nd: the number of dimensions of the data array.
  • starts: buffer for nd integers designateing the starting point the nd-dimensional subcube.
  • counts: buffer for nd integers designating the extents of the nd-dimensional subcube.
  • data: pointer to the output buffer for the data values to be read into memory. The nd-dimensional subcube is packed into a linear buffer in row-major ordering.
Returns
>= 0 to indicate success, < 0 to indicate error.

Make It A Bit Faster
Contact us
Disclaimers
FastBit source code
FastBit mailing list archive