Skip to content

Commit

Permalink
Merge branch 'finos:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
keikeicheung authored Sep 16, 2024
2 parents 04b1dc1 + 281e4d2 commit a0dfa23
Show file tree
Hide file tree
Showing 113 changed files with 1,478 additions and 1,032 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/cve-scanning.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
--enableRetired
- name: Upload Test results
if: ${{ always() }}
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: Depcheck report
path: ${{ github.workspace }}/reports
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object IgniteLocalConfig {
def create(k8sEnvironment: Boolean = isK8s,
clientMode: Boolean = true,
persistenceEnabled: Boolean = false): IgniteLocalConfig = {
logger.info("K8s enabled : {}", k8sEnvironment)
logger.debug("K8s enabled : {}", k8sEnvironment)
if (k8sEnvironment) {
createConfig(k8sDiscovery(), clientMode, persistenceEnabled)
} else {
Expand All @@ -44,7 +44,7 @@ object IgniteLocalConfig {
}

private def k8sDiscovery(): TcpDiscoverySpi = {
logger.info("Creating K8S config, Service : {}, NameSpace : {}", k8sServiceName, k8sServiceNamespace)
logger.debug("Creating K8S config, Service : {}, NameSpace : {}", k8sServiceName, k8sServiceNamespace)
val k8sConnectionConfig = new KubernetesConnectionConfiguration()
k8sConnectionConfig.setNamespace(k8sServiceNamespace)
k8sConnectionConfig.setServiceName(k8sServiceName)
Expand All @@ -71,7 +71,7 @@ class IgniteLocalConfig(private val clientMode: Boolean,
private val tcpDiscoverySpi: TcpDiscoverySpi,
private val metricConfig: MetricConfig = MetricConfig.defaultMetricsConfig()) {
def igniteConfiguration(): IgniteConfiguration = {
logger.info(s"Ignite Client mode = $clientMode, Persistence Enabled = $persistenceEnabled, TcpDiscovery = $tcpDiscoverySpi")
logger.debug(s"Ignite Client mode = $clientMode, Persistence Enabled = $persistenceEnabled, TcpDiscovery = $tcpDiscoverySpi")
val cfg = new IgniteConfiguration()

cfg.setGridLogger(new Slf4jLogger())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ class IgniteOrderStore(private val parentOrderCache: IgniteCache[Int, ParentOrde

val (counter, buffer) = mapToString(results)

logger.info(s"Loaded Distinct Ignite ChildOrder column $columnName for $counter rows")
logger.debug(s"Loaded Distinct Ignite ChildOrder column $columnName for $counter rows")

buffer
}

def getDistinct(columnName: String, startsWith: String, rowCount: Int): Iterable[String] = {
val query = new SqlFieldsQuery(s"select distinct $columnName from ChildOrder where $columnName LIKE \'$startsWith%\' limit ?")
query.setArgs(rowCount)
logger.info(query.getSql)
logger.debug(query.getSql)
val results = childOrderCache.query(query)

val (counter, buffer) = mapToString(results)

logger.info(s"Loaded Distinct Ignite ChildOrder column $columnName that starts with $startsWith for $counter rows")
logger.debug(s"Loaded Distinct Ignite ChildOrder column $columnName that starts with $startsWith for $counter rows")

buffer

Expand All @@ -98,7 +98,7 @@ class IgniteOrderStore(private val parentOrderCache: IgniteCache[Int, ParentOrde
val countValue = cursor.getAll.get(0).get(0)
val totalCount = countValue.asInstanceOf[Long]

logger.info(s"Ignite returned total count of `$totalCount` for ChildOrder with filter `$filterSql`")
logger.debug(s"Ignite returned total count of `$totalCount` for ChildOrder with filter `$filterSql`")
totalCount
}

Expand All @@ -113,7 +113,7 @@ class IgniteOrderStore(private val parentOrderCache: IgniteCache[Int, ParentOrde
.appendQuery(limitAndOffsetClause, QuerySeparator.SPACE)

val results = childOrderCache.query(query.buildFieldsQuery()).asScala.iterator.map(i => toChildOrder(i.asScala.toList))
logger.info(s"Loaded Ignite ChildOrder for $rowCount rows, from index : $startIndex with " +
logger.debug(s"Loaded Ignite ChildOrder for $rowCount rows, from index : $startIndex with " +
s"WHERE CLAUSE: `$whereClause` | ORDER BY CLAUSE: `$orderByClause`")

results
Expand Down Expand Up @@ -155,7 +155,7 @@ class IgniteOrderStore(private val parentOrderCache: IgniteCache[Int, ParentOrde

def childOrderCount(): Long = {
val cacheSize = childOrderCache.sizeLong(CachePeekMode.ALL)
logger.info(s"Ignite Child order has cache size of $cacheSize")
logger.debug(s"Ignite Child order has cache size of $cacheSize")
cacheSize
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ object IgniteVuuMain extends App with StrictLogging {
val certPath = defaultConfig.getString("vuu.certPath")
val keyPath = defaultConfig.getString("vuu.keyPath")

logger.info(s"[Ignite] Starting ignite in ${if(runAsIgniteServer) "Server" else "Client"} mode")
logger.debug(s"[Ignite] Starting ignite in ${if(runAsIgniteServer) "Server" else "Client"} mode")
private val igniteOrderStore = IgniteOrderStore(clientMode = !runAsIgniteServer)
if(runAsIgniteServer)
SaveOrdersInIgnite()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class IgniteOrderGenerator(orderStore: OrderStore) (implicit clock: Clock, lifec

def save(): Unit = {

logger.info("[Ignite] Saving orders to ignite.")
logger.debug("[Ignite] Saving orders to ignite.")
(0 until 4_000).foreach(i =>
executor.execute { () =>
val parent = ordersModel.createParent()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class IgniteOrderDataProvider(final val igniteStore: IgniteOrderStore)
internalTable.setSize(totalSize)//todo should this be long?
internalTable.setRange(VirtualizedRange(startIndex, endIndex))

logger.info(s"Loading data between $startIndex and $endIndex for $rowCount rows where total size $totalSize")
logger.debug(s"Loading data between $startIndex and $endIndex for $rowCount rows where total size $totalSize")

val index = new AtomicInteger(startIndex) // todo: get rid of working assumption here that the dataset is fairly immutable.
def updateTableRowAtIndex = tableUpdater(internalTable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ class BasketLoader(resourcePath: Option[String] = None) extends StrictLogging {
}
else {
val csvFile = csvFiles(0)
logger.info("Loading basket static:" + basketId + "(" + csvFile + ")")
logger.debug("Loading basket static:" + basketId + "(" + csvFile + ")")
val csvContent = FileLoader.readCsvContent(csvFile)

logger.info(s"Found ${csvContent.dataRows.length} constituents for basket $basketId")
logger.debug(s"Found ${csvContent.dataRows.length} constituents for basket $basketId")

csvContent.dataRows.map(row => toConstituentMap(csvContent, row))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ class BasketTradingConstituentJoinService(val table: DataTable, val tableContain
updateJoinTable(updateRows.toArray) match {
case Right(_) => NoAction()
case Left(errorReason) =>
logger.info(s"Could not update selection values${errorReason.reason}")
logger.debug(s"Could not update selection values${errorReason.reason}")
NoAction()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class BasketTradingService(val table: DataTable, val tableContainer: TableContai
override def sendToMarket(basketInstanceId: String)(ctx: RequestContext): ViewPortAction = {
val tableRow = table.asTable.pullRow(basketInstanceId)

logger.info("Sending basket to market:" + basketInstanceId + " (row:" + tableRow + ")")
logger.debug("Sending basket to market:" + basketInstanceId + " (row:" + tableRow + ")")

val constituents = getConstituents(basketInstanceId)

Expand All @@ -43,7 +43,7 @@ class BasketTradingService(val table: DataTable, val tableContainer: TableContai

val nos = NewOrder(side, symbol, quantity, price, instanceIdRic)

logger.info(s"Sending constituent to market $nos")
logger.debug(s"Sending constituent to market $nos")

omsApi.createOrder(nos)
})
Expand All @@ -59,7 +59,7 @@ class BasketTradingService(val table: DataTable, val tableContainer: TableContai
override def takeOffMarket(basketInstanceId: String)(ctx: RequestContext): ViewPortAction = {
val tableRow = table.asTable.pullRow(basketInstanceId)

logger.info("Tasking basket off market:" + basketInstanceId + " (row:" + tableRow + ")")
logger.debug("Tasking basket off market:" + basketInstanceId + " (row:" + tableRow + ")")

updateBasketTradeStatus(basketInstanceId, BasketStates.OFF_MARKET)

Expand All @@ -86,14 +86,14 @@ class BasketTradingService(val table: DataTable, val tableContainer: TableContai
}

private def onEditCell(key: String, columnName: String, data: Any, vp: ViewPort, session: ClientSessionId): ViewPortEditAction = {
logger.info("Change requested for cell value for key:" + key + "(" + columnName + ":" + data + ")")
logger.debug("Change requested for cell value for key:" + key + "(" + columnName + ":" + data + ")")

val currentData = getRowData(key, columnName)
if (currentData == data) {
logger.info("Current cell value is same and therefore skipping update for key:" + key + "(" + columnName + ":" + data + ")")
logger.debug("Current cell value is same and therefore skipping update for key:" + key + "(" + columnName + ":" + data + ")")
}
else {
logger.info("Changing cell value for key:" + key + "(" + columnName + ":" + data + ")")
logger.debug("Changing cell value for key:" + key + "(" + columnName + ":" + data + ")")
table.processUpdate(key, RowWithData(key, Map(BT.InstanceId -> key, columnName -> data)), clock.now())

columnName match {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class FixSequenceRpcService(implicit clock: Clock) extends RpcHandler with EditR
val sequencerNumber = table.pullRow(headKey).get("sequenceNumber").asInstanceOf[Int].toLong

if (sequencerNumber > 0) {
logger.info("I would now send this fix seq to a fix engine to reset, we're all good:" + sequencerNumber)
logger.trace("I would now send this fix seq to a fix engine to reset, we're all good:" + sequencerNumber)
CloseDialogViewPortAction(vp.id)
} else {
logger.error("Seq number not set, returning error")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,16 @@ public abstract class WebSocketApiJavaTestBase {
protected String tokenId;
protected String sessionId;

protected Clock clock = new DefaultClock();
protected LifecycleContainer lifecycle = new LifecycleContainer(clock);
protected TableDefContainer tableDefContainer = new TableDefContainer();
protected Clock clock;
protected LifecycleContainer lifecycle;
protected TableDefContainer tableDefContainer;

@BeforeAll
public void setUp() {
clock = new DefaultClock();
lifecycle = new LifecycleContainer(clock);
tableDefContainer = new TableDefContainer();

vuuClient = testStartUp();
tokenId = vuuClient.createAuthToken();
var sessionOption = OptionConverters.toJava(vuuClient.login(tokenId, "testUser"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ class SimulatedInstrumentProvider(instruments: Array[Array[String]], table: Data

val rowData = RowWithData(ric, rowAsMap)

logger.info(s"[INSTRUMENTS] Adding row $rowData")
logger.debug(s"[INSTRUMENTS] Adding row $rowData")

table.processUpdate(ric, rowData, timeProvider.now())

} else {
logger.info(s"dropped $row")
logger.debug(s"dropped $row")
}

})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class SimulatedPricesProvider(val table: DataTable, @volatile var maxSleep: Int

if (doEvery5Mins.shouldLog()) {
val startOfOpen = timeProvider.now() + 5_000
logger.info("[PRICES] Moving into Closed Market...")
logger.debug("[PRICES] Moving into Closed Market...")
entrySet.foreach(me => {
closeMarket(me.getKey, startOfOpen)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@ class TestListener extends OmsListener with StrictLogging {
}

override def onAck(ack: Ack): Unit = {
logger.info("onAck:" + ack)
logger.trace("onAck:" + ack)
ordersMap.put(ack.clientOrderId, TestOrderState(ack.symbol, ack.qty, ack.price, "ACKED", 0L, 0D))
}

override def onCancelAck(ack: CancelAck): Unit = {
logger.info("onCancelAck:" + ack)
logger.trace("onCancelAck:" + ack)
ordersMap.get(ack.clientOrderId) match {
case state: TestOrderState => ordersMap.put(ack.clientOrderId, state.copy(state = "CANCELLED"))
}
}

override def onReplaceAck(ack: ReplaceAck): Unit = {
logger.info("onReplaceAck:" + ack)
logger.trace("onReplaceAck:" + ack)
ordersMap.get(ack.clientOrderId) match {
case state: TestOrderState => ordersMap.put(ack.clientOrderId, state.copy(state = "ACKED"))
}
}

override def onFill(fill: Fill): Unit = {
logger.info("onFill:" + fill)
logger.trace("onFill:" + fill)
ordersMap.get(fill.clientOrderId) match {
case state: TestOrderState => ordersMap.put(fill.clientOrderId, state.copy(filledQty = state.filledQty + fill.fillQty))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class TestFriendlyPermissionChecker(val viewPort: ViewPort) extends RowPermissio

def addRole(mask: Int): Unit = {
permissions = PermissionSet.addRole(permissions, mask)
logger.info(s"AUTHS: added mask $mask permissions $permissions")
logger.debug(s"AUTHS: added mask $mask permissions $permissions")
}

def removeRole(mask: Int): Unit = {
permissions = PermissionSet.removeRole(permissions, mask)
logger.info(s"AUTHS: removed mask $mask permissions $permissions")
logger.debug(s"AUTHS: removed mask $mask permissions $permissions")
}

override def canSeeRow(row: RowData): Boolean = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ class SimulatedPricesProvider(val table: DataTable, @volatile var maxSleep: Int

if (doEvery5Mins.shouldLog()) {
val startOfOpen = timeProvider.now() + 5_000
logger.info("[PRICES] Moving into Closed Market...")
logger.debug("[PRICES] Moving into Closed Market...")
entrySet.foreach(me => {
closeMarket(me.getKey, startOfOpen)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class InstrumentsProvider(table: DataTable, client: InstrumentServiceClient)
private val keyField = table.getTableDef.keyField

override def doStart(): Unit = {
logger.info("Populating REST Instruments table...")
logger.debug("Populating REST Instruments table...")
client.getInstruments(limit = INSTRUMENTS_COUNT) match {
case Failure(ex) => logger.error("An unexpected error occurred when querying instrument service:", ex)
case Success(instruments) => instruments.iterator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class ReallyBigVirtualizedDataProvider(implicit clock: Clock) extends Virtualize
val (millisSetKeys, _ ) = timeIt { viewPort.setKeys(new VirtualizedViewPortKeys(tableKeys)) }

if(logAt.shouldLog()){
logger.info(s"[ReallyBigVirtualizedDataProvider] Complete runOnce millisRange = ${millisRange} millisSize=$millisSize millisRows=$millisRows millisGetKeys=$millisGetKeys millisSetKeys=$millisSetKeys")
logger.debug(s"[ReallyBigVirtualizedDataProvider] Complete runOnce millisRange = ${millisRange} millisSize=$millisSize millisRows=$millisRows millisGetKeys=$millisGetKeys millisSetKeys=$millisSetKeys")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public void persistApplicationLayout(String username, ObjectNode layoutDefinitio

public ApplicationLayout getApplicationLayout(String username) {
return repository.findById(username).orElseGet(() -> {
logger.info("No application layout for user, returning default");
logger.debug("No application layout for user, returning default");
return defaultLoader.getDefaultLayout();
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class IgniteTestStore (private val orderCache: IgniteCache[Int, TestOrderEntity]
}

private def getSQLAndMapResult(sqlQuery: IgniteSqlQuery): Iterable[TestOrderEntity] = {
logger.info("Querying ignite for " + sqlQuery)
logger.debug("Querying ignite for " + sqlQuery)

val results = orderCache.query(sqlQuery.buildFieldsQuery())

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class GuavaWindowedRowDataCache(val cacheSize: Int)(implicit clock: Clock) exten
val count = removalCounter.incrementAndGet()

if(logAtFrequency.shouldLog()){
logger.info(s"[ROWCACHE] Removing ${count} rowCache keys in last 10 seconds")
logger.debug(s"[ROWCACHE] Removing ${count} rowCache keys in last 10 seconds")
removalCounter.set(0)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ abstract class LifeCycleRunOncePerThreadExecutorRunner[T](val name: String, val
private final val setOfWork = new ConcurrentSkipListSet[WorkItem[T]]()

override def doStart(): Unit = {
logger.info(s"Starting up executor runner [$name]...")
logger.debug(s"Starting up executor runner [$name]...")
retryExecutor = Some(new ResubmitExecutor[T](name, countOfThreads, countOfThreads, 1000, TimeUnit.SECONDS, workQueue){
override def newCallable(r: FutureTask[T], t: Throwable): Callable[T] = {
selfRef.newCallable(r)
Expand Down Expand Up @@ -63,11 +63,11 @@ abstract class LifeCycleRunOncePerThreadExecutorRunner[T](val name: String, val

removedWork.foreach( item => {
setOfWork.remove(item)
logger.info("Removed work item from viewport threadpool:" + item)
logger.debug("Removed work item from viewport threadpool:" + item)
})

addedWork.foreach(item => {
println("Adding:" + item)
logger.debug("Adding:" + item)
setOfWork.add(item)
})

Expand All @@ -76,7 +76,7 @@ abstract class LifeCycleRunOncePerThreadExecutorRunner[T](val name: String, val
addedWork.foreach(work => {
executor.submit(new Callable[T] {
override def call(): T = {
logger.info("Adding work to vp threadpool.." + work)
logger.debug("Adding work to vp threadpool.." + work)
work.doWork()
}
})
Expand Down Expand Up @@ -104,7 +104,7 @@ abstract class LifeCycleRunOncePerThreadExecutorRunner[T](val name: String, val
executor.shutdown()
case None => //all good
}
logger.info(s"[$name] is exiting....")
logger.debug(s"[$name] is exiting....")
}

override def doInitialize(): Unit = {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class Runner(name: String, func: () => Unit, minCycleTime: Long = 1000, runOnce:
case NonFatal(e) => logger.error(s"[$name] threw an exception in run", e)
}

logger.info(s"[$name] is exiting")
logger.debug(s"[$name] is exiting")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ abstract class ResubmitExecutor[T](name: String, corePoolSize: Int, maxPoolSize:
if(shouldResubmit(futureTask, t)){
retry(futureTask, t)
if(logEvery.shouldLog()){
logger.info("Finished runnable:" + futureTask.get() + " resubmitting...")
logger.debug("Finished runnable:" + futureTask.get() + " resubmitting...")
}
}

Expand Down
Loading

0 comments on commit a0dfa23

Please sign in to comment.