Summary: BlockBasedTableConfig - ported Checksum - ported IndexType PlainTableConfig - added missing options - added EncodingType Test Plan: make rocksdbjava make jtest Differential Revision: https://reviews.facebook.net/D26595main
parent
e770d61751
commit
2c1bd8846f
@ -0,0 +1,39 @@ |
||||
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
package org.rocksdb; |
||||
|
||||
/** |
||||
* Checksum types used in conjunction with BlockBasedTable.. |
||||
*/ |
||||
public enum ChecksumType { |
||||
/** |
||||
* Not implemented yet. |
||||
*/ |
||||
kNoChecksum((byte) 0), |
||||
/** |
||||
* CRC32 Checksum |
||||
*/ |
||||
kCRC32c((byte)1), |
||||
/** |
||||
* XX Hash |
||||
*/ |
||||
kxxHash((byte)2); |
||||
|
||||
private final byte value_; |
||||
|
||||
private ChecksumType(byte value) { |
||||
value_ = value; |
||||
} |
||||
|
||||
/** |
||||
* Returns the byte value of the enumerations value |
||||
* |
||||
* @return byte representation |
||||
*/ |
||||
public byte getValue() { |
||||
return value_; |
||||
} |
||||
} |
@ -0,0 +1,55 @@ |
||||
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
package org.rocksdb; |
||||
|
||||
/** |
||||
* EncodingType |
||||
* |
||||
* <p>The value will determine how to encode keys |
||||
* when writing to a new SST file.</p> |
||||
* |
||||
* <p>This value will be stored |
||||
* inside the SST file which will be used when reading from |
||||
* the file, which makes it possible for users to choose |
||||
* different encoding type when reopening a DB. Files with |
||||
* different encoding types can co-exist in the same DB and |
||||
* can be read.</p> |
||||
*/ |
||||
public enum EncodingType { |
||||
/** |
||||
* Always write full keys without any special encoding. |
||||
*/ |
||||
kPlain((byte)0), |
||||
/** |
||||
* <p>Find opportunity to write the same prefix once for multiple rows. |
||||
* In some cases, when a key follows a previous key with the same prefix, |
||||
* instead of writing out the full key, it just writes out the size of the |
||||
* shared prefix, as well as other bytes, to save some bytes.</p> |
||||
* |
||||
* <p>When using this option, the user is required to use the same prefix |
||||
* extractor to make sure the same prefix will be extracted from the same key. |
||||
* The Name() value of the prefix extractor will be stored in the file. When |
||||
* reopening the file, the name of the options.prefix_extractor given will be |
||||
* bitwise compared to the prefix extractors stored in the file. An error |
||||
* will be returned if the two don't match.</p> |
||||
*/ |
||||
kPrefix((byte)1); |
||||
|
||||
private final byte value_; |
||||
|
||||
private EncodingType(byte value) { |
||||
value_ = value; |
||||
} |
||||
|
||||
/** |
||||
* Returns the byte value of the enumerations value |
||||
* |
||||
* @return byte representation |
||||
*/ |
||||
public byte getValue() { |
||||
return value_; |
||||
} |
||||
} |
@ -0,0 +1,37 @@ |
||||
// Copyright (c) 2014, Facebook, Inc. All rights reserved.
|
||||
// This source code is licensed under the BSD-style license found in the
|
||||
// LICENSE file in the root directory of this source tree. An additional grant
|
||||
// of patent rights can be found in the PATENTS file in the same directory.
|
||||
|
||||
package org.rocksdb; |
||||
|
||||
/** |
||||
* IndexType used in conjunction with BlockBasedTable. |
||||
*/ |
||||
public enum IndexType { |
||||
/** |
||||
* A space efficient index block that is optimized for |
||||
* binary-search-based index. |
||||
*/ |
||||
kBinarySearch((byte) 0), |
||||
/** |
||||
* The hash index, if enabled, will do the hash lookup when |
||||
* {@code Options.prefix_extractor} is provided. |
||||
*/ |
||||
kHashSearch((byte)1); |
||||
|
||||
private final byte value_; |
||||
|
||||
private IndexType(byte value) { |
||||
value_ = value; |
||||
} |
||||
|
||||
/** |
||||
* Returns the byte value of the enumerations value |
||||
* |
||||
* @return byte representation |
||||
*/ |
||||
public byte getValue() { |
||||
return value_; |
||||
} |
||||
} |
Loading…
Reference in new issue