-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finos#989 Added more detail to VirtualizedSessionTable
- Loading branch information
1 parent
dc07827
commit 64ffd2a
Showing
5 changed files
with
20 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 14 additions & 12 deletions
26
...n/ignite-plugin/src/main/scala/org/finos/vuu/table/virtualized/VirtualizedTableKeys.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,23 @@ | ||
package org.finos.vuu.table.virtualized | ||
|
||
import org.finos.toolbox.collection.window.ArrayBackedMovingWindow | ||
import org.finos.vuu.core.table.TablePrimaryKeys | ||
|
||
class VirtualizedTableKeys(cacheSize: Int) { | ||
private val window = new ArrayBackedMovingWindow[String](cacheSize) | ||
@volatile private var internalLength = 0 | ||
case class VirtualizedTableKeys(range: VirtualizedRange, data: Array[String], cacheSize: Int = 10_000) extends TablePrimaryKeys{ | ||
|
||
def setDataInRange(length: Int, from: Int, to: Int, data: Array[String]): Unit = { | ||
window.setRange(from, to) | ||
(from until to).foreach(i => window.setAtIndex(i, data(i))) | ||
internalLength = length | ||
} | ||
def length: Int = internalLength | ||
def getAtIndex(index:Int): Option[String] = window.getAtIndex(index) | ||
private val window = new ArrayBackedMovingWindow[String](10_000) | ||
|
||
} | ||
window.setRange(range.from, range.to) | ||
|
||
case class VirtualizedDataTableData() { | ||
(range.from until range.to).foreach(i => window.setAtIndex(i, data(i))) | ||
|
||
def length: Int = range.size | ||
def getAtIndex(index:Int): Option[String] = window.getAtIndex(index) | ||
override def add(key: String): TablePrimaryKeys = ??? | ||
override def +(key: String): TablePrimaryKeys = ??? | ||
override def remove(key: String): TablePrimaryKeys = ??? | ||
override def -(key: String): TablePrimaryKeys = ??? | ||
override def sliceTableKeys(from: Int, until: Int): TablePrimaryKeys = ??? | ||
override def get(index: Int): String = ??? | ||
override def iterator: Iterator[String] = ??? | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters