Package net.snowflake.client.core
Class EventUtil
- java.lang.Object
-
- net.snowflake.client.core.EventUtil
-
public class EventUtil extends Object
Utility class to encapsulate support information pertaining to the EventHandler and events.- Author:
- jrosen
-
-
Field Summary
Fields Modifier and Type Field Description static StringDUMP_PATH_PROPstatic StringDUMP_SIZE_PROPstatic StringDUMP_SUBDIR
-
Constructor Summary
Constructors Constructor Description EventUtil()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetDumpFileId()static StringgetDumpPathPrefix()static EventHandlergetEventHandlerInstance()static longgetmaxDumpFileSizeBytes()static voidinitEventHandlerInstance(int maxEntries, int flushPeriodMs)Initializes the common eventHandler instance for all sessions/threadsstatic voidsetDumpPathPrefixForTesting(String value)Junit is not recognizing the system properties for EventTest, so overriding the value herestatic voidtriggerBasicEvent(Event.EventType type, String message, boolean flushBuffer)static voidtriggerStateTransition(BasicEvent.QueryState newState, String identifier)
-
-
-
Field Detail
-
DUMP_PATH_PROP
public static final String DUMP_PATH_PROP
- See Also:
- Constant Field Values
-
DUMP_SIZE_PROP
public static final String DUMP_SIZE_PROP
- See Also:
- Constant Field Values
-
DUMP_SUBDIR
public static final String DUMP_SUBDIR
- See Also:
- Constant Field Values
-
-
Method Detail
-
setDumpPathPrefixForTesting
public static void setDumpPathPrefixForTesting(String value)
Junit is not recognizing the system properties for EventTest, so overriding the value here- Parameters:
value- string value
-
initEventHandlerInstance
public static void initEventHandlerInstance(int maxEntries, int flushPeriodMs)Initializes the common eventHandler instance for all sessions/threads- Parameters:
maxEntries- - maximum number of buffered events before flushflushPeriodMs- - period of time between asynchronous buffer flushes
-
getEventHandlerInstance
public static EventHandler getEventHandlerInstance()
- Returns:
- the shared EventHandler instance
-
triggerBasicEvent
public static void triggerBasicEvent(Event.EventType type, String message, boolean flushBuffer)
-
triggerStateTransition
public static void triggerStateTransition(BasicEvent.QueryState newState, String identifier)
-
getDumpPathPrefix
public static String getDumpPathPrefix()
-
getDumpFileId
public static String getDumpFileId()
-
getmaxDumpFileSizeBytes
public static long getmaxDumpFileSizeBytes()
-
-