Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnibus CDB improvements #194

Merged
merged 10 commits into from
Jul 30, 2018
Merged
Show file tree
Hide file tree
Changes from 4 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
4 changes: 3 additions & 1 deletion ci/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir"
cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; }
trap cleanup EXIT

TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'
realpath() { python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$1"; }

TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'

# for osx: 0. update brew; 1. install cmake if missing; 2. (gcc) unlink pre-installed gcc; 3. (gcc) install desired version of gcc

Expand Down
4 changes: 3 additions & 1 deletion ci/install-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir"
cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; }
trap cleanup EXIT

TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'
realpath() { python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$1"; }

This comment was marked as spam.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ugh, ok you're right. i'll fix it

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in #199


TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'

CHECK_VERSION=0.12.0
CHECK_TARBALL="check-${CHECK_VERSION}.tar.gz"
Expand Down
5 changes: 4 additions & 1 deletion deps/ccommon/ci/before-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir"
cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; }
trap cleanup EXIT

TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'
realpath() { python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$1"; }

TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'


# for osx: 0. update brew; 1. install cmake if missing; 2. (gcc) unlink pre-installed gcc; 3. (gcc) install desired version of gcc

Expand Down
5 changes: 4 additions & 1 deletion deps/ccommon/ci/install-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ TEMP="$(mktemp -d -t TEMP.XXXXXXX)" || die "failed to make tmpdir"
cleanup() { [[ -n "${TEMP:-}" ]] && rm -rf "${TEMP}"; }
trap cleanup EXIT

TOPLEVEL="$(git -C "$(cd "$(dirname "$0")" >/dev/null || exit 1; pwd)" rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'
realpath() { python -c "import os,sys; print os.path.realpath(sys.argv[1])" "$1"; }

TOPLEVEL="$(cd "$(dirname "$(realpath "$0" >/dev/null || exit 1)")" && git rev-parse --show-toplevel)" || die 'failed to find TOPLEVEL'


CHECK_VERSION=0.12.0
CHECK_TARBALL="check-${CHECK_VERSION}.tar.gz"
Expand Down
18 changes: 9 additions & 9 deletions src/server/cdb/setting.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
#include <channel/cc_tcp.h>
#include <stream/cc_sockio.h>

/* option related */
/* name type default description */
#define CDB_OPTION(ACTION) \
ACTION( daemonize, OPTION_TYPE_BOOL, false, "daemonize the process" )\
ACTION( pid_filename, OPTION_TYPE_STR, NULL, "file storing the pid" )\
ACTION( cdb_file_path, OPTION_TYPE_STR, "db.cdb", "location of the .cdb file" )\
ACTION( use_mmap, OPTION_TYPE_BOOL, false, "use mmap to load the file, false: use the heap")\
ACTION( dlog_intvl, OPTION_TYPE_UINT, 500, "debug log flush interval(ms)" )\
ACTION( klog_intvl, OPTION_TYPE_UINT, 100, "cmd log flush interval(ms)" )
/* option related */
/* name type default description */
#define CDB_OPTION(ACTION) \
ACTION( daemonize, OPTION_TYPE_BOOL, false, "daemonize the process" )\
ACTION( pid_filename, OPTION_TYPE_STR, NULL, "file storing the pid" )\
ACTION( cdb_file_path, OPTION_TYPE_STR, "db.cdb", "location of the .cdb file" )\
ACTION( use_mmap, OPTION_TYPE_BOOL, false, "use mmap to load the file, false: use the heap" )\
ACTION( dlog_intvl, OPTION_TYPE_UINT, 500, "debug log flush interval(ms)" )\
ACTION( klog_intvl, OPTION_TYPE_UINT, 100, "cmd log flush interval(ms)" )

typedef struct {
CDB_OPTION(OPTION_DECLARE)
Expand Down
1 change: 1 addition & 0 deletions src/storage/cdb/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
perf.data*
*.cdb*
.cargo/
dist/
3 changes: 3 additions & 0 deletions src/storage/cdb/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
##-- cdb Cargo.toml file --##
# note: do not change the mark above #

[workspace]

members = [
Expand Down
3 changes: 2 additions & 1 deletion src/storage/cdb/cdb_rs/src/cdb/backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use super::Result;
use std::fs::File;
use std::io::{Cursor, Read};
use std::path::Path;
use cdb::MAIN_TABLE_SIZE_BYTES;


pub enum Backend {
Expand All @@ -29,7 +30,7 @@ impl AsRef<[u8]> for Backend {
impl Backend {
pub fn noop() -> Result<Backend> {
let v = {
let mut buf = Vec::with_capacity(2048);
let mut buf = Vec::with_capacity(MAIN_TABLE_SIZE_BYTES as usize);
let mut cur = Cursor::new(buf);
super::Writer::new(&mut cur)?;
cur.into_inner()
Expand Down
10 changes: 0 additions & 10 deletions src/storage/cdb/scripts/config.sh

This file was deleted.

47 changes: 0 additions & 47 deletions src/storage/cdb/scripts/vendorize.sh

This file was deleted.