Skip to content

Commit

Permalink
#989 Brought in Tomasz's latest changes on Ignite piece. Some issues …
Browse files Browse the repository at this point in the history
…with querying ignite.
  • Loading branch information
chrisjstevo committed Jan 4, 2024
1 parent 3f31f83 commit a1bed3d
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import org.apache.ignite.cache.{QueryEntity, QueryIndex, QueryIndexType}
import org.apache.ignite.configuration.{CacheConfiguration, DataStorageConfiguration, IgniteConfiguration}
import org.finos.vuu.data.order.ChildOrder

import java.nio.file.Paths
import java.util.concurrent.atomic.AtomicBoolean
import scala.jdk.CollectionConverters.IterableHasAsJava

Expand All @@ -18,7 +19,7 @@ object IgniteLocalConfig {

cfg.setClientMode(clientMode)
cfg.setPeerClassLoadingEnabled(true)
cfg.setWorkDirectory("./target/ignite")
cfg.setWorkDirectory(Paths.get("./target/ignite").toFile.getAbsolutePath)

cfg.setCacheConfiguration(
createParentOrderCacheConfig(),
Expand Down
4 changes: 3 additions & 1 deletion example/main/src/main/scala/org/finos/vuu/SimulMain.scala
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ import org.finos.vuu.core.module.price.PriceModule
import org.finos.vuu.core.module.simul.SimulationModule
import org.finos.vuu.core.module.typeahead.TypeAheadModule
import org.finos.vuu.core.module.vui.VuiStateModule
import org.finos.vuu.example.virtualtable.module.VirtualTableModule
import org.finos.vuu.data.order.ignite.IgniteOrderStore
import org.finos.vuu.example.virtualtable.module.{IgniteOrderDataModule, VirtualTableModule}
import org.finos.vuu.net.auth.AlwaysHappyAuthenticator
import org.finos.vuu.net.http.VuuHttp2ServerOptions
import org.finos.vuu.net.{AlwaysHappyLoginValidator, Authenticator, LoggedInTokenValidator}
Expand Down Expand Up @@ -89,6 +90,7 @@ object SimulMain extends App with StrictLogging {
.withModule(PermissionModule())
.withModule(BasketModule(omsApi))
.withModule(VirtualTableModule())
.withModule(IgniteOrderDataModule(IgniteOrderStore()))
.withPlugin(VirtualizedTablePlugin)

val vuuServer = new VuuServer(config)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import org.finos.vuu.example.virtualtable.provider.IgniteOrderDataProvider
import org.finos.vuu.plugin.virtualized.api.VirtualizedSessionTableDef


class IgniteOrderDataModule extends DefaultModule {
object IgniteOrderDataModule extends DefaultModule {
final val NAME = "IGNITE_ORDER_VIRTUAL"

def apply(igniteOrderStore: IgniteOrderStore)(implicit clock: Clock, lifecycle: LifecycleContainer, tableDefContainer: TableDefContainer): ViewServerModule = {
Expand All @@ -21,7 +21,7 @@ class IgniteOrderDataModule extends DefaultModule {
keyField = "orderId",
Columns.fromNames("orderId".string(), "quantity".int(), "price".long(), "side".string(), "trader".string())
),
(table, _) => new IgniteOrderDataProvider(table, igniteOrderStore),
(table, _) => new IgniteOrderDataProvider(igniteOrderStore),
(table, _, _, _) => ViewPortDef(
columns = table.getTableDef.columns,
service = new VirtualService()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import org.finos.vuu.viewport.ViewPort

import java.util.concurrent.atomic.AtomicInteger

class IgniteOrderDataProvider(final val table: DataTable,
final val igniteStore: IgniteOrderStore)(implicit clock: Clock) extends VirtualizedProvider {
private final val internalTable = table.asInstanceOf[VirtualizedSessionTable]
class IgniteOrderDataProvider(final val igniteStore: IgniteOrderStore)(implicit clock: Clock) extends VirtualizedProvider {


override def runOnce(viewPort: ViewPort): Unit = {

val internalTable = viewPort.table.asTable.asInstanceOf[VirtualizedSessionTable]

val range = viewPort.getRange
val totalSize = igniteStore.childOrderCount().toInt

Expand All @@ -35,15 +36,15 @@ class IgniteOrderDataProvider(final val table: DataTable,
})
}

override def subscribe(key: String): Unit = ???
override def subscribe(key: String): Unit = {}

override def doStart(): Unit = ???
override def doStart(): Unit = {}

override def doStop(): Unit = ???
override def doStop(): Unit = {}

override def doInitialize(): Unit = ???
override def doInitialize(): Unit = {}

override def doDestroy(): Unit = ???
override def doDestroy(): Unit = {}

override val lifecycleId: String = ???
override val lifecycleId: String = "org.finos.vuu.example.virtualtable.provider.IgniteOrderDataProvider"
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class VirtualizedViewPortTest extends VuuServerTestCase {
withVuuServer(VirtualTableModule()) {
vuuServer =>

vuuServer.registerPlugin(new VirtualizedTablePlugin())
vuuServer.registerPlugin(VirtualizedTablePlugin)

vuuServer.login("testUser", "testToken")

Expand Down
2 changes: 1 addition & 1 deletion vuu/src/main/resources/runconfigurations/SimulMain.run.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<option name="MAIN_CLASS_NAME" value="org.finos.vuu.SimulMain" />
<module name="main" />
<option name="PROGRAM_PARAMETERS" value="-Xmx20G -Xlog:gc*=debug:stdout " />
<option name="VM_PARAMETERS" value="-Dlogback.configurationFile=logback.xml --add-opens=java.base/java.nio=ALL-UNNAMED" />
<option name="VM_PARAMETERS" value="-Dlogback.configurationFile=logback.xml --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/jdk.internal.access=ALL-UNNAMED --add-opens=java.base/jdk.internal.misc=ALL-UNNAMED --add-opens=java.base/sun.nio.ch=ALL-UNNAMED --add-opens=java.base/sun.util.calendar=ALL-UNNAMED --add-opens=java.management/com.sun.jmx.mbeanserver=ALL-UNNAMED --add-opens=jdk.internal.jvmstat/sun.jvmstat.monitor=ALL-UNNAMED --add-opens=java.base/sun.reflect.generics.reflectiveObjects=ALL-UNNAMED --add-opens=jdk.management/com.sun.management.internal=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.nio=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.util.concurrent=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.locks=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.math=ALL-UNNAMED --add-opens=java.sql/java.sql=ALL-UNNAMED --add-opens=java.base/java.lang.reflect=ALL-UNNAMED --add-opens=java.base/java.time=ALL-UNNAMED --add-opens=java.base/java.text=ALL-UNNAMED --add-opens=java.management/sun.management=ALL-UNNAMED --add-opens java.desktop/java.awt.font=ALL-UNNAMED" />
<extension name="coverage">
<pattern>
<option name="PATTERN" value="org.finos.vuu.*" />
Expand Down

0 comments on commit a1bed3d

Please sign in to comment.