See: Description
Interface | Description |
---|---|
CLibrary |
This JNA interface provides functions in the standard C library.
|
Cmd<T> |
Represents an operation of a k2hdkc cluster.
|
Class | Description |
---|---|
AddSubkeyCmd |
Adds a new subkey to a current subkey.
|
CasGetCmd |
Gets a variable from a cluster using a CAS operation.
|
CasIncDecCmd |
Increments and Decrements a variable in a cluster by using a CAS operation.
|
CasInitCmd |
Initializes a variable in a cluster by using a CAS operation.
|
CasSetCmd |
Sets a value in a cluster by using a CAS operation.
|
ClearSubkeysCmd |
Clears subkeys of a key.
|
Cluster |
Holds configurations of a chmpx slave server.
|
CmdBase |
Holds common data types, members and instance methods of
Cmd derived classes. |
GetAttrsCmd |
Retrievs attributes of a key.
|
GetCmd |
Retrievs the value of a key.
|
GetSubkeysCmd |
Retrievs subkeys of a key.
|
K2hashAttrPack |
Holds information about an k2hash's attribute of a key.
|
KeyQueueAddCmd |
Adds a new element to a queue.
|
KeyQueueRemoveCmd |
Removes a new element to a queue.
|
QueueAddCmd |
Adds a new element to a queue.
|
QueueRemoveCmd |
Removes a new element to a queue.
|
RemoveCmd |
Removes a key from a cluster.
|
RemoveSubkeyCmd |
Removes a subkey from the current subkeys.
|
RenameCmd |
Rename a key in a cluster.
|
Result<T> |
Holds common data types, members and instance methods of derived classes.
|
Session | |
SetAllCmd |
Stores a key with a value and subkeys.
|
SetCmd |
Adds a key to a cluster.
|
SetSubkeysCmd |
Replaces current subkeys with new one.
|
Enum | Description |
---|---|
Cluster.NativeLogLevel |
Defines levels used to dump a k2hdkc data
|
Cluster.NativeStackLogLevel |
Defines the level which native library puts logs.
|
Cmd.DataType |
DataType of data in CAS operation
|
Contains 3 primary classes.
Cluster
holds configurations to connect a chmpx slave process and it provides simple methods to
set a value to a k2hdk and get a value from it.
You can extends the Cluster
class if you want to add more methods.
Session
provides a connection with a chmpx slave process which communicate with a k2hdk clustering system.
CmdBase
provide an operation against a k2hdk clustering system and holds the result of the
operation in Result
object.
Please see each class document for the each example.
The class K2hdkcLibrary
, ChmpxLibrary
and K2hashLibrary
implements Java Native Access's Library
interface. Their visibilities are mostly package private because we think it is hard to control
for application programmers. So they are not extensible currently.
The Logback is a successor to the popular log4j project. Suppose you want to write logs to stdout in the "debug" level, you could write a logback.xml as:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<!-- encoders are assigned the type
ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
<encoder>
<!-- <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern> -->
<pattern>%-5level [%thread] %date{ISO8601} %F:%L - %msg%n</pattern>
</encoder>
</appender>
<root level="debug">
<appender-ref ref="STDOUT" />
</root>
Please see the logback manual more
details.
In addtion, we use native C API libraries. We sometimes want to see how they work. The class
Cluster
provides methods to change log levels. The following code works as:
try (Cluster cluster = Cluster.of("slave.yaml");
Session sess = Session.of(cluster); ) {
cluster.setNativeLogLevel(
"/tmp/native.log",
Cluster.NativeStackLogLevel.StackK2hdkc,
Cluster.NativeLogLevel.SeverityInfo);
// ...
} catch (IOException ex) {
logger.error("message {}", ex.getMessage());
}
}
Copyright © 2020. All rights reserved.