My grid db instance is running in FIXED mode. I am able to connect griddb using jdbc in java. Now, I am trying to use com.toshiba.mwcloud Gridstore library to connect with griddb. As the library has better functions to interact with griddb containers and to store data in time series. I am using 20001 port as I am able connect via jdbc using the same port. Below is code I am using to connect via Gridstore library.
public static void main(String[] args) throws GSException {
Properties props = new Properties();
props.setProperty("notificationMember", "192.168.139.234:20001");
props.setProperty("clusterName", "myCluster");
props.setProperty("user", "admin");
props.setProperty("password", "admin");
GridStore store = GridStoreFactory.getInstance()
.getGridStore(props);
// working till here
Collection<String, Student> students = store.putCollection("STUDENT", Student.class);
Student student = students.createRow();
Query<Student> query = people.query("select * where name = 'John'");
RowSet<Student> rs = query.fetch(false);
while (rs.hasNext()) {
// Update the searched Row
Person student1 = rs.next();
System.out.println("Name: "+ student1.name +" Age: "+ student1.age);
}
System.out.println("endded connection");
}
static class Student {
@RowKey
String name;
int age;
}
I am getting below error:
Exception in thread "main" com.toshiba.mwcloud.gs.common.GSStatementException: [10054:TXN_CLIENT_VERSION_NOT_ACCEPTABLE] (connectClientVersion=15, serverVersion=-9) (address=192.168.139.234:20001, partitionId=0)
at com.toshiba.mwcloud.gs.subnet.NodeConnection.executeStatementDirect(NodeConnection.java:528)
at com.toshiba.mwcloud.gs.subnet.NodeConnection.executeStatement(NodeConnection.java:345)
at com.toshiba.mwcloud.gs.subnet.NodeConnection.connect(NodeConnection.java:947)
at com.toshiba.mwcloud.gs.subnet.NodeConnectionPool.resolve(NodeConnectionPool.java:166)
at com.toshiba.mwcloud.gs.subnet.NodeResolver.updateConnectionAndClusterInfo(NodeResolver.java:680)
at com.toshiba.mwcloud.gs.subnet.NodeResolver.prepareConnectionAndClusterInfo(NodeResolver.java:565)
at com.toshiba.mwcloud.gs.subnet.NodeResolver.getPartitionCount(NodeResolver.java:241)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel$5.execute(GridStoreChannel.java:2277)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.executeStatement(GridStoreChannel.java:1847)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.executeResolver(GridStoreChannel.java:2084)
at com.toshiba.mwcloud.gs.subnet.GridStoreChannel.resolvePartitionId(GridStoreChannel.java:2274)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putContainer(SubnetGridStore.java:992)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putCollection(SubnetGridStore.java:1049)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putCollection(SubnetGridStore.java:797)
at com.toshiba.mwcloud.gs.subnet.SubnetGridStore.putCollection(SubnetGridStore.java:100)
at com.toshiba.mwcloud.gs.partitioned.PartStore.putCollection(PartStore.java:177)
at gridfs.GridStoreConnectionExample.main(GridStoreConnectionExample.java:31)
I am getting the error at line Collection<String, Student> students = store.putCollection("STUDENT", Student.class)
Not sure, what I am missing here.
gs_stat looks like below:
{
"checkpoint": {
"backupOperation": 0,
"duplicateLog": 0,
"endTime": 1707936787683,
"mode": "RECOVERY_CHECKPOINT",
"normalCheckpointOperation": 0,
"pendingPartition": 0,
"periodicCheckpoint": "ACTIVE",
"requestedCheckpointOperation": 0,
"startTime": 1707936786930
},
"cluster": {
"activeCount": 1,
"applyRuleLimitTime": "2024-02-15T00:23:51.095+05:30",
"autoGoal": "ACTIVE",
"clusterName": "myCluster",
"clusterRevisionId": "68961817-525f-491a-83df-b6e229bb7b36",
"clusterRevisionNo": 6,
"clusterStatus": "MASTER",
"currentRule": "Initial",
"designatedCount": 1,
"loadBalancer": "ACTIVE",
"master": {
"address": "127.0.0.1",
"port": 10040
},
"nodeList": [
{
"address": "127.0.0.1",
"port": 10040
}
],
"nodeStatus": "ACTIVE",
"notificationMode": "FIXED_LIST",
"partitionStatus": "NORMAL",
"startupTime": "2024-02-15T00:23:05.095+05:30",
"syncCount": 2
},
"currentTime": "2024-02-15T00:23:35+05:30",
"performance": {
"backgroundMinRate": 0.1,
"backupCount": 0,
"checkpointFileFlushCount": 128,
"checkpointFileFlushTime": 31,
"checkpointWrite": 0,
"checkpointWriteCompressTime": 0,
"checkpointWriteSize": 0,
"checkpointWriteTime": 0,
"currentTime": 1707936815881,
"dataFileAllocateSize": 1245184,
"dataFileSize": 1245184,
"dataFileUsageRate": 0.8421052631578947,
"expirationDetail": {
"batchScanNum": 2000,
"batchScanTotalNum": 0,
"batchScanTotalTime": 0,
"erasableExpiredTime": "",
"estimatedBatchFree": 0,
"estimatedErasableExpiredTime": "",
"lastBatchFree": 0,
"latestExpirationCheckTime": "Under measurement"
},
"logFileFlushCount": 256,
"logFileFlushTime": 1134,
"numBackground": 0,
"numConnection": 1,
"numNoExpireTxn": 0,
"numSession": 0,
"numTxn": 0,
"ownerCount": 128,
"peakProcessMemory": 69464064,
"poolBufferMemory": 393216,
"processMemory": 69464064,
"sqlNumConnection": 1,
"sqlStoreSwapRead": 0,
"sqlStoreSwapReadSize": 0,
"sqlStoreSwapReadTime": 0,
"sqlStoreSwapWrite": 0,
"sqlStoreSwapWriteSize": 0,
"sqlStoreSwapWriteTime": 0,
"storeCompressionMode": "NO_BLOCK_COMPRESSION",
"storeDetail": {
"batchFreeMapData": {
"storeMemory": 0,
"storeUse": 0,
"swapRead": 0,
"swapWrite": 0
},
"batchFreeRowData": {
"storeMemory": 0,
"storeUse": 0,
"swapRead": 0,
"swapWrite": 0
},
"mapData": {
"storeMemory": 0,
"storeUse": 393216,
"swapRead": 0,
"swapWrite": 0
},
"metaData": {
"storeMemory": 393216,
"storeUse": 393216,
"swapRead": 6,
"swapWrite": 0
},
"rowData": {
"storeMemory": 0,
"storeUse": 262144,
"swapRead": 0,
"swapWrite": 0
}
},
"storeMemory": 393216,
"storeMemoryLimit": 1073741824,
"storeTotalUse": 1048576,
"swapRead": 6,
"swapReadSize": 393216,
"swapReadTime": 7,
"swapReadUncompressTime": 0,
"swapWrite": 0,
"swapWriteCompressTime": 0,
"swapWriteSize": 0,
"swapWriteTime": 0,
"totalBackupLsn": 0,
"totalLockConflictCount": 0,
"totalOtherLsn": 0,
"totalOwnerLsn": 72,
"totalReadOperation": 0,
"totalRowRead": 0,
"totalRowWrite": 0,
"totalWriteOperation": 0,
"txnDetail": {
"totalBackgroundOperation": 0
}
},
"recovery": {
"progressRate": 1
},
"version": "5.3.0-39942 CE"
}