Enum FDBTraceFormat
- java.lang.Object
-
- java.lang.Enum<FDBTraceFormat>
-
- com.apple.foundationdb.record.provider.foundationdb.FDBTraceFormat
-
- All Implemented Interfaces:
Serializable
,Comparable<FDBTraceFormat>
@API(MAINTAINED) public enum FDBTraceFormat extends Enum<FDBTraceFormat>
The FoundationDB native client can be configured to emit its trace logs (containing important metrics and instrumentation information) in one of several different formats. This enum can be passed to theFDBDatabaseFactory.setTraceFormat(FDBTraceFormat)
method in order to control the client's behavior.This class is
API.Status.MAINTAINED
. However, additional values to this enum may be added if more trace format options become available.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getOptionValue()
Get the value to supply tosetTraceFormat()
.boolean
isDefaultValue()
Get whether this is the default trace format.static FDBTraceFormat
valueOf(String name)
Returns the enum constant of this type with the specified name.static FDBTraceFormat[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFAULT
public static final FDBTraceFormat DEFAULT
Use the system default. If theFDB_NETWORK_OPTION_TRACE_FORMAT
environment variable is set or if one has already calledNetworkOptions.setTraceFormat(String)
, then the client trace logs will follow whatever format was already specified. If neither of those are set, then the logs will used the default format, which isXML
.
-
XML
public static final FDBTraceFormat XML
Format the trace logs as XML. The full logs are contained withinTrace
tags, and each log entry is a single-lineTraceEvent
XML element. EachTraceEvent
will associate log keys and values as attributes of the element (not as child elements). Logs will be written to files with a.xml
extension.
-
JSON
public static final FDBTraceFormat JSON
Format the trace logs as JSON. Each log entry is a single-line JSON document. Each entry will associate log keys and values as fields of the JSON document. Logs will be written to files with a.json
extension.
-
-
Method Detail
-
values
public static FDBTraceFormat[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (FDBTraceFormat c : FDBTraceFormat.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static FDBTraceFormat valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getOptionValue
@Nonnull public String getOptionValue()
Get the value to supply tosetTraceFormat()
. The exception here is the default value which can be achieved by not supplying any value to that option.- Returns:
- the value to pass to
setTraceFormat()
-
isDefaultValue
public boolean isDefaultValue()
Get whether this is the default trace format. SeeDEFAULT
for more details.- Returns:
- whether this indicates the client should use the default trace format
-
-