This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Preamble | |
PROGNAME=$(basename $0) | |
function error_exit | |
{ | |
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 | |
exit ${2:-1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Preamble | |
PROGNAME=$(basename $0) | |
function error_exit | |
{ | |
echo "${PROGNAME}: ${1:-"Unknown Error"}" 1>&2 | |
exit ${2:-1} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* On-heap. */ | |
CachingBocas cache = BocasServices.cache().maximumSize(1000).expireAfterAccess(30L, TimeUnit.SECONDS).build(bocas); | |
/** Off-heap. */ | |
CachingBocas directCache = BocasServices.cache().maximumWeight(536870912L).buildDirect(bocas); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** Provide the path to the database environment. */ | |
Bocas bocas = JEBocas.basic("/path/to/env"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* On-heap repository. */ | |
Bocas heap = BocasServices.memory(); | |
/* Off-heap repository. */ | |
Bocas direct = BocasServices.direct(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BocasEntry { | |
/** Returns the entry key. */ | |
public ByteString getKey(); | |
/** Returns the entry value. */ | |
public BocasValue getValue(); | |
/** | |
* Turns this entry into a loaded entry. | |
* @throws BocasException if unable to read the value payload. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BocasValue implements InputSupplier<InputStream> { | |
/** | |
* Turns this value into a loaded one. | |
* @throws BocasException if unable to load the payload. | |
*/ | |
public LoadedBocasValue load(); | |
/** | |
* Turns this value into a direct one. | |
* @throws BocasException if unable to load the payload. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class BocasValue implements InputSupplier<InputStream> { | |
/** Returns the payload size in bytes (if known). */ | |
public Integer getSize(); | |
/** Copies and returns the internal data. */ | |
public byte[] toByteArray() throws IOException; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Bocas { | |
/* | |
* Checking if the repository contains entries. | |
*/ | |
boolean contains(ByteString key); | |
Set<ByteString> contained(Iterable<ByteString> keys); | |
/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Group { | |
public int getHits(); | |
public Set<String> getGroupNames(); | |
public Group getGroup(String name); | |
} |
NewerOlder