Skip to content

Commit

Permalink
finos#989 making it optional to run ignite server in single startup
Browse files Browse the repository at this point in the history
  • Loading branch information
naleeha committed Feb 14, 2024
1 parent 095d331 commit a9f5522
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 9 deletions.
12 changes: 12 additions & 0 deletions example/apache-ignite/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,18 @@

# Apache Ignite Sample

## Running VUU and Ignite server as single process
1. Open static main and set to run as ignite server
```scala
org.finos.vuu.example.ignite.IgniteVuuMain

val runAsIgniteServer = ture

```
2. Run the static main

## Running VUU against Separate Ignite Server

How to run:

1. Run Ignite Cluster Application (run config for IntelliJ checked in):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ object IgniteVuuMain extends App with StrictLogging {
implicit val tableDefContainer: TableDefContainer = new TableDefContainer(Map())

logger.info("[VUU] Starting...")
val runAsIgniteServer = false

val store = new MemoryBackedVuiStateStore()

Expand All @@ -55,10 +56,10 @@ object IgniteVuuMain extends App with StrictLogging {
val certPath = defaultConfig.getString("vuu.certPath")
val keyPath = defaultConfig.getString("vuu.keyPath")

logger.info("[Ignite] Starting ignite in server mode")
private val igniteOrderStore = IgniteOrderStore(clientMode = false)
private val igniteOrderGenerator = new IgniteOrderGenerator(igniteOrderStore)
igniteOrderGenerator.save()
logger.info(s"[Ignite] Starting ignite in ${if(runAsIgniteServer) "Server" else "Client"} mode")
private val igniteOrderStore = IgniteOrderStore(clientMode = !runAsIgniteServer)
if(runAsIgniteServer)
SaveOrdersInIgnite()

val config = VuuServerConfig(
VuuHttp2ServerOptions()
Expand Down Expand Up @@ -94,4 +95,9 @@ object IgniteVuuMain extends App with StrictLogging {

vuuServer.join()

private def SaveOrdersInIgnite(): Unit = {
val igniteOrderGenerator = new IgniteOrderGenerator(igniteOrderStore)
igniteOrderGenerator.save()
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,8 @@ class VirtualizedSessionTable(clientSessionId: ClientSessionId,

override def processDelete(rowKey: String): Unit = super.processDelete(rowKey)

override def getColumnValueProvider: ColumnValueProvider = {
logger.info(s"[TESTING] provider from virtualized table")
override def getColumnValueProvider: ColumnValueProvider =
this.getProvider.asInstanceOf[ColumnValueProvider]
}

def setRange(range: VirtualizedRange): Unit = {
this.range = range
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class GenericTypeAheadRpcHandler(val tableContainer: TableContainer) extends Typ

def getUniqueFieldValues(tableMap: Map[String, String], column: String, ctx: RequestContext): Array[String] = {

logger.info(s"[TESTING] getting unique field value $column")
val tableName = tableMap("table")

tableContainer.getTable(tableName) match {
Expand All @@ -23,7 +22,6 @@ class GenericTypeAheadRpcHandler(val tableContainer: TableContainer) extends Typ

override def getUniqueFieldValuesStartingWith(tableMap: Map[String, String], column: String, starts: String, ctx: RequestContext): Array[String] = {

logger.info(s"[TESTING] getting unique field value $column starting with $starts")
val tableName = tableMap("table")

tableContainer.getTable(tableName) match {
Expand Down

0 comments on commit a9f5522

Please sign in to comment.