Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-02


com.sigmadynamics.server.DataServices.DatabaseProvider
Class BatchUpdater

java.lang.Object
  extended by com.sigmadynamics.server.DataServices.DatabaseProvider.BatchUpdater


public class BatchUpdater
extends java.lang.Object

Field Summary
protected  boolean autoFlush
           
protected  boolean autoGrowBuffer
           
protected  int batchCount
           
protected  int batchSize
           
protected  BatchUpdaterClient buClient
           
protected static SDCategory log
           
protected static java.text.NumberFormat numberFormat
           
protected  int numberOfPlacemarkers
           
protected  ValueSetter setter
           
protected static int TYPE_BYTE_ARRAY
           
protected static int TYPE_DATE
           
protected static int TYPE_DATECALENDAR
           
protected static int TYPE_DOUBLE
           
protected static int TYPE_INPUTSTREAM
           
protected static int TYPE_INTEGER
           
protected static int TYPE_LONG
           
protected static int TYPE_NULL
           
protected static int TYPE_STRING
           

 

Constructor Summary
BatchUpdater(DatabaseSettings ds, BatchUpdaterClient owner, int numPlacemarkers, int batchSize, int maxQueueLength, boolean autoFlush, boolean autoGrowBuffer)
           

 

Method Summary
 void close()
           
 int discard()
          For a manual-flush BatchUpdater only, discards all records in the buffer.
protected  void finalize()
           
 void flush()
           
protected  void flush(boolean evenWhileClosing)
           
protected  ValueSetter getValueSetter()
           
protected  void incrementPlacemarkers(int n)
           
 boolean isThrottling()
          Returns the throttling mode.
 void operation()
          Submission of new work.
protected  java.sql.PreparedStatement prepareStatement(java.sql.Connection conn)
           
 void saveDateValue(int index, DateWrapper value)
           
 void saveDateValue(int index, long value)
           
 void saveNullValue(int index, int sqlType)
           
 void saveValue(int index, byte[] value)
           
 void saveValue(int index, double value)
           
 void saveValue(int index, java.io.InputStream value, int length)
           
 void saveValue(int index, int value)
           
 void saveValue(int index, long value)
           
 void saveValue(int index, java.lang.String value)
           
 void setBatchSize(int n)
           
 void setThrottling(boolean throttling)
          Sets throttling mode.
static void shutdown(long totalShutdownTimeoutMSec)
          Stop all the batch updaters in a controlled manner.
static void start(DatabaseSettings ds, TimerProviderAndJobRunner tpjr)
           
protected  void timedFlush(long now)
          Flush the buffer if things have been waiting for a given amount of time.

 

Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

 

Field Detail

TYPE_NULL

protected static final int TYPE_NULL
See Also:
Constant Field Values

TYPE_STRING

protected static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_DOUBLE

protected static final int TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_LONG

protected static final int TYPE_LONG
See Also:
Constant Field Values

TYPE_BYTE_ARRAY

protected static final int TYPE_BYTE_ARRAY
See Also:
Constant Field Values

TYPE_INPUTSTREAM

protected static final int TYPE_INPUTSTREAM
See Also:
Constant Field Values

TYPE_DATE

protected static final int TYPE_DATE
See Also:
Constant Field Values

TYPE_DATECALENDAR

protected static final int TYPE_DATECALENDAR
See Also:
Constant Field Values

TYPE_INTEGER

protected static final int TYPE_INTEGER
See Also:
Constant Field Values

batchSize

protected int batchSize

batchCount

protected int batchCount

buClient

protected BatchUpdaterClient buClient

numberOfPlacemarkers

protected int numberOfPlacemarkers

setter

protected ValueSetter setter

autoFlush

protected final boolean autoFlush

autoGrowBuffer

protected final boolean autoGrowBuffer

log

protected static final SDCategory log

numberFormat

protected static final java.text.NumberFormat numberFormat

Constructor Detail

BatchUpdater

public BatchUpdater(DatabaseSettings ds,
                    BatchUpdaterClient owner,
                    int numPlacemarkers,
                    int batchSize,
                    int maxQueueLength,
                    boolean autoFlush,
                    boolean autoGrowBuffer)

Method Detail

getValueSetter

protected ValueSetter getValueSetter()

isThrottling

public boolean isThrottling()
Returns the throttling mode.
Returns:
true if throttling is enabled, otherwise false.

setThrottling

public void setThrottling(boolean throttling)
Sets throttling mode. Throttling cannot be turned off if the updater is synchronous.
Parameters:
throttling - throttling mode.
Throws:
java.lang.IllegalArgumentException - if the method is called on a synchronous updater with false as an argument.

operation

public void operation()
Submission of new work.

prepareStatement

protected java.sql.PreparedStatement prepareStatement(java.sql.Connection conn)

flush

public void flush()

discard

public int discard()
For a manual-flush BatchUpdater only, discards all records in the buffer.
Returns:
the number of discarded records.

flush

protected void flush(boolean evenWhileClosing)

close

public void close()

incrementPlacemarkers

protected void incrementPlacemarkers(int n)

saveValue

public void saveValue(int index,
                      java.lang.String value)

saveValue

public void saveValue(int index,
                      double value)

saveValue

public void saveValue(int index,
                      long value)

saveValue

public void saveValue(int index,
                      int value)

saveDateValue

public void saveDateValue(int index,
                          long value)

saveDateValue

public void saveDateValue(int index,
                          DateWrapper value)

saveValue

public void saveValue(int index,
                      byte[] value)

saveValue

public void saveValue(int index,
                      java.io.InputStream value,
                      int length)

saveNullValue

public void saveNullValue(int index,
                          int sqlType)

start

public static void start(DatabaseSettings ds,
                         TimerProviderAndJobRunner tpjr)

shutdown

public static void shutdown(long totalShutdownTimeoutMSec)
Stop all the batch updaters in a controlled manner.

timedFlush

protected void timedFlush(long now)
Flush the buffer if things have been waiting for a given amount of time.

This method is called by the BatchFlusher. The BatchUpdater will do a flush operation if there have been data in the buffer that has been waiting for a specified amount of time.

Parameters:
now - the approximate current time

finalize

protected void finalize()
Overrides:
finalize in class java.lang.Object

setBatchSize

public void setBatchSize(int n)

Skip navigation links

Oracle Fusion Middleware Java API Reference for Oracle Real-Time Decisions
11g Release 1 (11.1.1)

E17787-02


Copyright © 2010, 2011, Oracle. All rights reserved.