Permalink
Browse files

Shilling

  • Loading branch information...
yavwa committed Sep 1, 2016
1 parent c6a6fd6 commit ad14db0ee28b66faad67e28dfbba758aa35150c8
Showing with 1,697 additions and 754 deletions.
  1. BIN Logo.png
  2. BIN Shillings_Qt_windows_wallet/Shilling-windows.exe
  3. BIN crypto shilling.png
  4. +1 −0 src/leveldb/.gitignore
  5. +4 −0 src/leveldb/AUTHORS
  6. +36 −0 src/leveldb/CONTRIBUTING.md
  7. +138 −0 src/leveldb/README.md
  8. +32 −13 src/leveldb/build_detect_platform
  9. +118 −0 src/leveldb/db/autocompact_test.cc
  10. +2 −0 src/leveldb/db/c.cc
  11. +46 −31 src/leveldb/db/corruption_test.cc
  12. +5 −6 src/leveldb/db/db_bench.cc
  13. +104 −58 src/leveldb/db/db_impl.cc
  14. +13 −4 src/leveldb/db/db_impl.h
  15. +39 −16 src/leveldb/db/db_iter.cc
  16. +5 −3 src/leveldb/db/db_iter.h
  17. +138 −37 src/leveldb/db/db_test.cc
  18. +1 −1 src/leveldb/db/dbformat.cc
  19. +6 −3 src/leveldb/db/dbformat.h
  20. +225 −0 src/leveldb/db/dumpfile.cc
  21. +12 −3 src/leveldb/db/filename.cc
  22. +5 −0 src/leveldb/db/filename.h
  23. +2 −1 src/leveldb/db/filename_test.cc
  24. +15 −189 src/leveldb/db/leveldb_main.cc
  25. +2 −2 src/leveldb/db/log_format.h
  26. +18 −11 src/leveldb/db/log_reader.cc
  27. +2 −2 src/leveldb/db/log_reader.h
  28. +36 −6 src/leveldb/db/log_test.cc
  29. +117 −45 src/leveldb/db/repair.cc
  30. +5 −0 src/leveldb/db/skiplist.h
  31. +6 −0 src/leveldb/db/table_cache.cc
  32. +105 −59 src/leveldb/db/version_set.cc
  33. +15 −2 src/leveldb/db/version_set.h
  34. +2 −2 src/leveldb/db/write_batch_internal.h
  35. +1 −1 src/leveldb/doc/bench/db_bench_tree_db.cc
  36. +3 −3 src/leveldb/doc/impl.html
  37. +3 −3 src/leveldb/doc/log_format.txt
  38. +5 −4 src/leveldb/helpers/memenv/memenv.cc
  39. +0 −1 src/leveldb/include/leveldb/c.h
  40. +1 −1 src/leveldb/include/leveldb/cache.h
  41. +1 −1 src/leveldb/include/leveldb/db.h
  42. +25 −0 src/leveldb/include/leveldb/dumpfile.h
  43. +2 −2 src/leveldb/include/leveldb/env.h
  44. +1 −1 src/leveldb/include/leveldb/iterator.h
  45. +1 −1 src/leveldb/include/leveldb/options.h
  46. +1 −1 src/leveldb/include/leveldb/slice.h
  47. +92 −0 src/leveldb/issues/issue178_test.cc
  48. +59 −0 src/leveldb/issues/issue200_test.cc
  49. BIN src/leveldb/memenv_test.exe
  50. +17 −18 src/leveldb/port/atomic_pointer.h
  51. +8 −7 src/leveldb/port/port_posix.h
  52. +4 −6 src/leveldb/port/port_win.cc
  53. +3 −2 src/leveldb/port/thread_annotations.h
  54. +8 −7 src/leveldb/table/block.cc
  55. +1 −1 src/leveldb/table/block_builder.h
  56. +1 −1 src/leveldb/table/filter_block_test.cc
  57. +1 −1 src/leveldb/table/format.cc
  58. +12 −3 src/leveldb/table/table.cc
  59. +30 −0 src/leveldb/table/table_test.cc
  60. +1 −1 src/leveldb/util/arena.cc
  61. +1 −1 src/leveldb/util/arena.h
  62. +3 −3 src/leveldb/util/arena_test.cc
  63. +1 −1 src/leveldb/util/bloom.cc
  64. +2 −1 src/leveldb/util/bloom_test.cc
  65. +1 −4 src/leveldb/util/cache.cc
  66. +5 −5 src/leveldb/util/coding_test.cc
  67. +64 −157 src/leveldb/util/env_posix.cc
  68. +9 −0 src/leveldb/util/env_win.cc
  69. +12 −5 src/leveldb/util/hash.cc
  70. +54 −0 src/leveldb/util/hash_test.cc
  71. +0 −9 src/leveldb/util/logging.cc
  72. +0 −4 src/leveldb/util/logging.h
  73. +6 −1 src/leveldb/util/random.h
  74. +1 −1 src/leveldb/util/testharness.cc
  75. +1 −1 src/leveldb/util/testutil.cc
  76. +1 −1 src/leveldb/util/testutil.h
View
BIN Logo.png
Binary file not shown.
Binary file not shown.
View
Binary file not shown.
View
@@ -6,6 +6,7 @@ build_config.mk
*.so.*
*_test
db_bench
leveldbutil
Release
Debug
Benchmark
View
@@ -6,3 +6,7 @@ Google Inc.
# Initial version authors:
Jeffrey Dean <jeff@google.com>
Sanjay Ghemawat <sanjay@google.com>
# Partial list of contributors:
Kevin Regan <kevin.d.regan@gmail.com>
Johan Bilien <jobi@litl.com>
@@ -0,0 +1,36 @@
# Contributing
We'd love to accept your code patches! However, before we can take them, we
have to jump a couple of legal hurdles.
## Contributor License Agreements
Please fill out either the individual or corporate Contributor License
Agreement as appropriate.
* If you are an individual writing original source code and you're sure you
own the intellectual property, then sign an [individual CLA](https://developers.google.com/open-source/cla/individual).
* If you work for a company that wants to allow you to contribute your work,
then sign a [corporate CLA](https://developers.google.com/open-source/cla/corporate).
Follow either of the two links above to access the appropriate CLA and
instructions for how to sign and return it.
## Submitting a Patch
1. Sign the contributors license agreement above.
2. Decide which code you want to submit. A submission should be a set of changes
that addresses one issue in the [issue tracker](https://github.com/google/leveldb/issues).
Please don't mix more than one logical change per submission, because it makes
the history hard to follow. If you want to make a change
(e.g. add a sample or feature) that doesn't have a corresponding issue in the
issue tracker, please create one.
3. **Submitting**: When you are ready to submit, send us a Pull Request. Be
sure to include the issue number you fixed and the name you used to sign
the CLA.
## Writing Code ##
If your contribution contains code, please make sure that it follows
[the style guide](http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml).
Otherwise we will have to ask you to make changes, and that's no fun for anyone.
View
@@ -0,0 +1,138 @@
**LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.**
Authors: Sanjay Ghemawat (sanjay@google.com) and Jeff Dean (jeff@google.com)
# Features
* Keys and values are arbitrary byte arrays.
* Data is stored sorted by key.
* Callers can provide a custom comparison function to override the sort order.
* The basic operations are `Put(key,value)`, `Get(key)`, `Delete(key)`.
* Multiple changes can be made in one atomic batch.
* Users can create a transient snapshot to get a consistent view of data.
* Forward and backward iteration is supported over the data.
* Data is automatically compressed using the [Snappy compression library](http://code.google.com/p/snappy).
* External activity (file system operations etc.) is relayed through a virtual interface so users can customize the operating system interactions.
* [Detailed documentation](http://htmlpreview.github.io/?https://github.com/google/leveldb/blob/master/doc/index.html) about how to use the library is included with the source code.
# Limitations
* This is not a SQL database. It does not have a relational data model, it does not support SQL queries, and it has no support for indexes.
* Only a single process (possibly multi-threaded) can access a particular database at a time.
* There is no client-server support builtin to the library. An application that needs such support will have to wrap their own server around the library.
# Performance
Here is a performance report (with explanations) from the run of the
included db_bench program. The results are somewhat noisy, but should
be enough to get a ballpark performance estimate.
## Setup
We use a database with a million entries. Each entry has a 16 byte
key, and a 100 byte value. Values used by the benchmark compress to
about half their original size.
LevelDB: version 1.1
Date: Sun May 1 12:11:26 2011
CPU: 4 x Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
CPUCache: 4096 KB
Keys: 16 bytes each
Values: 100 bytes each (50 bytes after compression)
Entries: 1000000
Raw Size: 110.6 MB (estimated)
File Size: 62.9 MB (estimated)
## Write performance
The "fill" benchmarks create a brand new database, in either
sequential, or random order. The "fillsync" benchmark flushes data
from the operating system to the disk after every operation; the other
write operations leave the data sitting in the operating system buffer
cache for a while. The "overwrite" benchmark does random writes that
update existing keys in the database.
fillseq : 1.765 micros/op; 62.7 MB/s
fillsync : 268.409 micros/op; 0.4 MB/s (10000 ops)
fillrandom : 2.460 micros/op; 45.0 MB/s
overwrite : 2.380 micros/op; 46.5 MB/s
Each "op" above corresponds to a write of a single key/value pair.
I.e., a random write benchmark goes at approximately 400,000 writes per second.
Each "fillsync" operation costs much less (0.3 millisecond)
than a disk seek (typically 10 milliseconds). We suspect that this is
because the hard disk itself is buffering the update in its memory and
responding before the data has been written to the platter. This may
or may not be safe based on whether or not the hard disk has enough
power to save its memory in the event of a power failure.
## Read performance
We list the performance of reading sequentially in both the forward
and reverse direction, and also the performance of a random lookup.
Note that the database created by the benchmark is quite small.
Therefore the report characterizes the performance of leveldb when the
working set fits in memory. The cost of reading a piece of data that
is not present in the operating system buffer cache will be dominated
by the one or two disk seeks needed to fetch the data from disk.
Write performance will be mostly unaffected by whether or not the
working set fits in memory.
readrandom : 16.677 micros/op; (approximately 60,000 reads per second)
readseq : 0.476 micros/op; 232.3 MB/s
readreverse : 0.724 micros/op; 152.9 MB/s
LevelDB compacts its underlying storage data in the background to
improve read performance. The results listed above were done
immediately after a lot of random writes. The results after
compactions (which are usually triggered automatically) are better.
readrandom : 11.602 micros/op; (approximately 85,000 reads per second)
readseq : 0.423 micros/op; 261.8 MB/s
readreverse : 0.663 micros/op; 166.9 MB/s
Some of the high cost of reads comes from repeated decompression of blocks
read from disk. If we supply enough cache to the leveldb so it can hold the
uncompressed blocks in memory, the read performance improves again:
readrandom : 9.775 micros/op; (approximately 100,000 reads per second before compaction)
readrandom : 5.215 micros/op; (approximately 190,000 reads per second after compaction)
## Repository contents
See doc/index.html for more explanation. See doc/impl.html for a brief overview of the implementation.
The public interface is in include/*.h. Callers should not include or
rely on the details of any other header files in this package. Those
internal APIs may be changed without warning.
Guide to header files:
* **include/db.h**: Main interface to the DB: Start here
* **include/options.h**: Control over the behavior of an entire database,
and also control over the behavior of individual reads and writes.
* **include/comparator.h**: Abstraction for user-specified comparison function.
If you want just bytewise comparison of keys, you can use the default
comparator, but clients can write their own comparator implementations if they
want custom ordering (e.g. to handle different character encodings, etc.)
* **include/iterator.h**: Interface for iterating over data. You can get
an iterator from a DB object.
* **include/write_batch.h**: Interface for atomically applying multiple
updates to a database.
* **include/slice.h**: A simple module for maintaining a pointer and a
length into some other byte array.
* **include/status.h**: Status is returned from many of the public interfaces
and is used to report success and various kinds of errors.
* **include/env.h**:
Abstraction of the OS environment. A posix implementation of this interface is
in util/env_posix.cc
* **include/table.h, include/table_builder.h**: Lower-level modules that most
clients probably won't use directly
@@ -20,7 +20,7 @@
#
# The PLATFORM_CCFLAGS and PLATFORM_CXXFLAGS might include the following:
#
# -DLEVELDB_CSTDATOMIC_PRESENT if <cstdatomic> is present
# -DLEVELDB_ATOMIC_PRESENT if <atomic> is present
# -DLEVELDB_PLATFORM_POSIX for Posix-based platforms
# -DSNAPPY if the Snappy library is present
#
@@ -44,6 +44,10 @@ if test -z "$CXX"; then
CXX=g++
fi
if test -z "$TMPDIR"; then
TMPDIR=/tmp
fi
# Detect OS
if test -z "$TARGET_OS"; then
TARGET_OS=`uname -s`
@@ -68,6 +72,12 @@ if [ "$CXX" = "g++" ]; then
fi
case "$TARGET_OS" in
CYGWIN_*)
PLATFORM=OS_LINUX
COMMON_FLAGS="$MEMCMP_FLAG -lpthread -DOS_LINUX -DCYGWIN"
PLATFORM_LDFLAGS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
Darwin)
PLATFORM=OS_MACOSX
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
@@ -94,6 +104,12 @@ case "$TARGET_OS" in
PLATFORM_LIBS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
GNU/kFreeBSD)
PLATFORM=OS_KFREEBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_KFREEBSD"
PLATFORM_LIBS="-lpthread"
PORT_FILE=port/port_posix.cc
;;
NetBSD)
PLATFORM=OS_NETBSD
COMMON_FLAGS="$MEMCMP_FLAG -D_REENTRANT -DOS_NETBSD"
@@ -127,6 +143,16 @@ case "$TARGET_OS" in
# man ld: +h internal_name
PLATFORM_SHARED_LDFLAGS="-shared -Wl,+h -Wl,"
;;
IOS)
PLATFORM=IOS
COMMON_FLAGS="$MEMCMP_FLAG -DOS_MACOSX"
[ -z "$INSTALL_PATH" ] && INSTALL_PATH=`pwd`
PORT_FILE=port/port_posix.cc
PLATFORM_SHARED_EXT=
PLATFORM_SHARED_LDFLAGS=
PLATFORM_SHARED_CFLAGS=
PLATFORM_SHARED_VERSIONED=
;;
OS_WINDOWS_CROSSCOMPILE | NATIVE_WINDOWS)
PLATFORM=OS_WINDOWS
COMMON_FLAGS="-fno-builtin-memcmp -D_REENTRANT -DOS_WINDOWS -DLEVELDB_PLATFORM_WINDOWS -DWINVER=0x0500 -D__USE_MINGW_ANSI_STDIO=1"
@@ -163,25 +189,18 @@ if [ "$CROSS_COMPILE" = "true" ]; then
# Cross-compiling; do not try any compilation tests.
true
else
# If -std=c++0x works, use <cstdatomic>. Otherwise use port_posix.h.
$CXX $CXXFLAGS -std=c++0x -x c++ - -o /dev/null 2>/dev/null <<EOF
#include <cstdatomic>
int main() {}
EOF
if [ "$?" = 0 ]; then
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX -DLEVELDB_CSTDATOMIC_PRESENT"
PLATFORM_CXXFLAGS="-std=c++0x"
else
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
fi
CXXOUTPUT="${TMPDIR}/leveldb_build_detect_platform-cxx.$$"
COMMON_FLAGS="$COMMON_FLAGS -DLEVELDB_PLATFORM_POSIX"
# Test whether tcmalloc is available
$CXX $CXXFLAGS -x c++ - -o /dev/null -ltcmalloc 2>/dev/null <<EOF
$CXX $CXXFLAGS -x c++ - -o $CXXOUTPUT -ltcmalloc 2>/dev/null <<EOF
int main() {}
EOF
if [ "$?" = 0 ]; then
PLATFORM_LIBS="$PLATFORM_LIBS -ltcmalloc"
fi
rm -f $CXXOUTPUT 2>/dev/null
fi
PLATFORM_CCFLAGS="$PLATFORM_CCFLAGS $COMMON_FLAGS"
Oops, something went wrong.

0 comments on commit ad14db0

Please sign in to comment.