Package com.senzing.g2.engine
Interface G2Diagnostic
-
- All Superinterfaces:
G2Fallible
- All Known Implementing Classes:
G2DiagnosticJNI
public interface G2Diagnostic extends G2Fallible
Defines the Java interface to the G2 diagnostic functions. The G2 diagnostic functions provide diagnostics and statistics pertaining to the host system and the Senzing repository.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description int
checkDBPerf(int secondsToRun, StringBuffer response)
Runs non-destruction DB performance tests and writes detail of the result as JSON in the specifiedStringBuffer
.int
closeEntityListBySize(long entityListBySizeHandle)
Experimental/internal method to close the result set associated with the specified handle obtained fromgetEntityListBySize(long,Result)
.int
destroy()
Uninitializes the G2 diagnostic object.int
fetchNextEntityBySize(long entityListBySizeHandle, StringBuffer response)
Experimental/internal method for obtaining the next sized entity result with the specified handle obtained fromgetEntityListBySize(long,Result)
.int
findEntitiesByFeatureIDs(String features, StringBuffer response)
This methods asks g2 for any entities having any of the lib feat id specified in the "features" doc.long
getAvailableMemory()
Returns the available number of bytes of RAM on the systemint
getDataSourceCounts(StringBuffer response)
Experimental/internal method for obtaining data source counts.int
getDBInfo(StringBuffer response)
Gets information about database connections and generates a JSON document describing the result in the following format (sans pretty-printing):int
getEntityDetails(long entityID, boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining diagnostic entity details.int
getEntityListBySize(long entitySize, Result<Long> exportHandle)
Experimental/internal method for obtaining diagnostic information on sized entities.int
getEntityResume(long entityID, StringBuffer response)
Experimental/internal method for obtaining diagnostic entity resume.int
getEntitySizeBreakdown(long minimumEntitySize, boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining entity size breakdown.int
getFeature(long libFeatID, StringBuffer response)
Experimental/internal method for obtaining diagnostic feature information.int
getGenericFeatures(String featureType, long maximumEstimatedCount, StringBuffer response)
Experimental/internal method for obtaining generic features.int
getLogicalCores()
Returns the number of logical cores on the system.int
getMappingStatistics(boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining mapping statistics.int
getPhysicalCores()
Returns the number of physical cores on the system.int
getRelationshipDetails(long relationshipID, boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining diagnostic relationship details.int
getResolutionStatistics(StringBuffer response)
Experimental/internal method for obtaining resolution statistics.long
getTotalSystemMemory()
Returns the total number of bytes of RAM on the systemint
init(String moduleName, String iniParams, boolean verboseLogging)
Initializes the G2 Diagnostic object with the specified module name, init parameters and flag indicating verbose logging.int
initWithConfigID(String moduleName, String iniParams, long initConfigID, boolean verboseLogging)
Initializes the G2 Diagnostic object with the module name, initialization parameters, verbose logging flag and a specific configuration ID identifying the configuration to use.int
reinit(long initConfigID)
Reinitializes with the specified configuration ID.-
Methods inherited from interface com.senzing.g2.engine.G2Fallible
clearLastException, getLastException, getLastExceptionCode
-
-
-
-
Method Detail
-
init
int init(String moduleName, String iniParams, boolean verboseLogging)
Initializes the G2 Diagnostic object with the specified module name, init parameters and flag indicating verbose logging. If theG2CONFIGFILE
init parameter is absent then the default configuration from the repository is used.- Parameters:
moduleName
- A short name given to this instance of the diagnostic object.iniParams
- A JSON string containing configuration parameters.verboseLogging
- Enable diagnostic logging which will print a massive amount of information to stdout.- Returns:
- Zero (0) on success, non-zero on failure.
-
initWithConfigID
int initWithConfigID(String moduleName, String iniParams, long initConfigID, boolean verboseLogging)
Initializes the G2 Diagnostic object with the module name, initialization parameters, verbose logging flag and a specific configuration ID identifying the configuration to use.- Parameters:
moduleName
- The module name with which to initialize.iniParams
- The JSON initialization parameters.initConfigID
- The specific configuration ID to initialize with.verboseLogging
- Whether or not to initialize with verbose logging.- Returns:
- Zero (0) on success and non-zero on failure.
-
reinit
int reinit(long initConfigID)
Reinitializes with the specified configuration ID.- Parameters:
initConfigID
- The configuration ID with which to reinitialize.- Returns:
- Zero (0) on success and non-zero on failure.
-
destroy
int destroy()
Uninitializes the G2 diagnostic object.- Returns:
- Zero (0) on success and non-zero on failure.
-
getTotalSystemMemory
long getTotalSystemMemory()
Returns the total number of bytes of RAM on the system- Returns:
- The number of bytes on success and negative one (-1) on failure.
-
getAvailableMemory
long getAvailableMemory()
Returns the available number of bytes of RAM on the system- Returns:
- The number of bytes on success and negative one (-1) on failure.
-
getPhysicalCores
int getPhysicalCores()
Returns the number of physical cores on the system.- Returns:
- The number of cores on success and negative one (-1) on failure.
-
getLogicalCores
int getLogicalCores()
Returns the number of logical cores on the system. This may be different that physical due to hyper-threading.- Returns:
- The number of cores on success and negative one (-1) on failure.
-
checkDBPerf
int checkDBPerf(int secondsToRun, StringBuffer response)
Runs non-destruction DB performance tests and writes detail of the result as JSON in the specifiedStringBuffer
.- Parameters:
secondsToRun
- How long to run the database performance test.response
- TheStringBuffer
in which to write the JSON text that details the result of the performance test.- Returns:
- Zero (0) on success and non-zero on failure.
-
getDBInfo
int getDBInfo(StringBuffer response)
Gets information about database connections and generates a JSON document describing the result in the following format (sans pretty-printing):{ "Hybrid Mode": false, "Database Details": [ { "Name": "SENZDB", "Type": "POSTGRES" } ] }
- Parameters:
response
- TheStringBuffer
in which to write Json document describing the result.- Returns:
- Zero (0) on success and non-zero on failure.
-
findEntitiesByFeatureIDs
int findEntitiesByFeatureIDs(String features, StringBuffer response)
This methods asks g2 for any entities having any of the lib feat id specified in the "features" doc. The "features" also contains an entity id that specifies the entity to be ignored in the returned values. The response is written as a JSON document to the specifiedStringBuffer
.The format of the "features" document is as follows:
{ "ENTITY_ID": <entity_id>, "LIB_FEAT_IDS": [ <id1>, <id2>, ... <idn> ] }
The format of the response document is as follows (sans pretty-printing):
[ { "LIB_FEAT_ID": <lib_feat_id>, "USAGE_TYPE": "<usage_type>", "RES_ENT_ID": <entity_id> }, ... ]
- Parameters:
features
- Json document describing the desired features.response
- TheStringBuffer
to write the JSON response to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getDataSourceCounts
int getDataSourceCounts(StringBuffer response)
Experimental/internal method for obtaining data source counts.- Parameters:
response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getMappingStatistics
int getMappingStatistics(boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining mapping statistics.- Parameters:
includeInternalFeatures
-true
if internal features should be included andfalse
if they should be excluded.response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getGenericFeatures
int getGenericFeatures(String featureType, long maximumEstimatedCount, StringBuffer response)
Experimental/internal method for obtaining generic features.- Parameters:
featureType
- The feature type code.maximumEstimatedCount
- The maximum estimated count.response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getEntitySizeBreakdown
int getEntitySizeBreakdown(long minimumEntitySize, boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining entity size breakdown.- Parameters:
minimumEntitySize
- The minimum entity size.includeInternalFeatures
-true
if internal features should be included andfalse
if they should be excluded.response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getEntityDetails
int getEntityDetails(long entityID, boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining diagnostic entity details.- Parameters:
entityID
- The entity ID for the entity.includeInternalFeatures
-true
if internal features should be included andfalse
if they should be excluded.response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getResolutionStatistics
int getResolutionStatistics(StringBuffer response)
Experimental/internal method for obtaining resolution statistics.- Parameters:
response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getRelationshipDetails
int getRelationshipDetails(long relationshipID, boolean includeInternalFeatures, StringBuffer response)
Experimental/internal method for obtaining diagnostic relationship details.- Parameters:
relationshipID
- The relationship ID identifying the relationship.includeInternalFeatures
-true
if internal features should be included andfalse
if they should be excluded.response
- TheStringBuffer
to write the JSON response document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getEntityResume
int getEntityResume(long entityID, StringBuffer response)
Experimental/internal method for obtaining diagnostic entity resume.- Parameters:
entityID
- The entity ID.response
- TheStringBuffer
to write the JSON result document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getFeature
int getFeature(long libFeatID, StringBuffer response)
Experimental/internal method for obtaining diagnostic feature information.- Parameters:
libFeatID
- TheLIB_FEAT_ID
identifying the feature.response
- TheStringBuffer
to write the JSON result document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
getEntityListBySize
int getEntityListBySize(long entitySize, Result<Long> exportHandle)
Experimental/internal method for obtaining diagnostic information on sized entities.- Parameters:
entitySize
- The entity size.exportHandle
- TheResult
object on which the result handle will be set.- Returns:
- Zero (0) on success and non-zero on failure.
-
fetchNextEntityBySize
int fetchNextEntityBySize(long entityListBySizeHandle, StringBuffer response)
Experimental/internal method for obtaining the next sized entity result with the specified handle obtained fromgetEntityListBySize(long,Result)
.- Parameters:
entityListBySizeHandle
- The handle for the result set.response
- TheStringBuffer
to write the JSON result document to.- Returns:
- Zero (0) on success and non-zero on failure.
-
closeEntityListBySize
int closeEntityListBySize(long entityListBySizeHandle)
Experimental/internal method to close the result set associated with the specified handle obtained fromgetEntityListBySize(long,Result)
.- Parameters:
entityListBySizeHandle
- The handle for the result set.- Returns:
- Zero (0) on success and non-zero on failure.
-
-