-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Takes Too much Time during get and put operation using version 2.1.214 #4054
Comments
You are querying your database by looping over every single row, and then decoding a JSON blob for every row. |
@grandinj Reason for iterating every row is that during update I don't have way to direct update with ID i have to iterate through openMap of collection fetch its id and put into it.. Is there any way i can direct update it using its ID or fetch data directly using ID?? |
We are using h2 MVStore version 2.1.214
MVStore configDB = new MVStore.Builder().fileName(GlobalConstants.CURRENT_DIR +
GlobalConstants.PATH_SEPARATOR +
GlobalConstants.CONFIG_DIR +
GlobalConstants.PATH_SEPARATOR +
"????")
.encryptionKey(new String(Base64.getDecoder().decode(buffer.getBytes())).toCharArray())
.backgroundExceptionHandler((thread, exception) -> LOGGER.error(exception))
.autoCommitDisabled()
.open();
TO get data we use following logic::
Over here during fetching data my thread gets stuck for almost 1-2 minutes also in thread dump i get following:
10:43:07 AM
java.lang.Thread.State: RUNNABLE
at org.h2.security.AES.decrypt(AES.java:134)
at org.h2.store.fs.encrypt.XTS.decrypt(XTS.java:83)
at org.h2.store.fs.encrypt.FileEncrypt.readInternal(FileEncrypt.java:185)
at org.h2.store.fs.encrypt.FileEncrypt.read(FileEncrypt.java:171)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:456)
at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
at org.h2.mvstore.Chunk.readBufferForPage(Chunk.java:422)
at org.h2.mvstore.MVStore.readPage(MVStore.java:2569)
at org.h2.mvstore.MVMap.readPage(MVMap.java:633)
at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1125)
at org.h2.mvstore.Cursor.hasNext(Cursor.java:64)
at org.h2.mvstore.MVMap$2$1.hasNext(MVMap.java:746)
at [email protected]/java.util.concurrent.ConcurrentMap.forEach(Unknown Source)
at com.mindarray.db.ConfigDBServiceImpl.lambda$get$11(ConfigDBServiceImpl.java:249)
at com.mindarray.db.ConfigDBServiceImpl$$Lambda$280/0x0000000800304ad0.handle(Unknown Source)
at io.vertx.core.impl.ContextBase.lambda$null$0(ContextBase.java:137)
at io.vertx.core.impl.ContextBase$$Lambda$218/0x00000008002b9cd8.handle(Unknown Source)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
at io.vertx.core.impl.ContextBase.lambda$executeBlocking$1(ContextBase.java:135)
at io.vertx.core.impl.ContextBase$$Lambda$216/0x00000008002b9470.run(Unknown Source)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at io.vertx.core.impl.TaskQueue$$Lambda$197/0x00000008002b16e0.run(Unknown Source)
at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.run(Unknown Source)
10:44:37 AM
java.lang.Thread.State: RUNNABLE
at org.h2.store.fs.encrypt.XTS.decrypt(XTS.java:73)
at org.h2.store.fs.encrypt.FileEncrypt.readInternal(FileEncrypt.java:185)
at org.h2.store.fs.encrypt.FileEncrypt.read(FileEncrypt.java:171)
at org.h2.mvstore.DataUtils.readFully(DataUtils.java:456)
at org.h2.mvstore.FileStore.readFully(FileStore.java:98)
at org.h2.mvstore.Chunk.readBufferForPage(Chunk.java:422)
at org.h2.mvstore.MVStore.readPage(MVStore.java:2569)
at org.h2.mvstore.MVMap.readPage(MVMap.java:633)
at org.h2.mvstore.Page$NonLeaf.getChildPage(Page.java:1125)
at org.h2.mvstore.Cursor.hasNext(Cursor.java:64)
at org.h2.mvstore.MVMap$2$1.hasNext(MVMap.java:746)
at [email protected]/java.util.concurrent.ConcurrentMap.forEach(Unknown Source)
at com.mindarray.db.ConfigDBServiceImpl.lambda$update$33(ConfigDBServiceImpl.java:655)
at com.mindarray.db.ConfigDBServiceImpl$$Lambda$278/0x0000000800304680.handle(Unknown Source)
at com.mindarray.db.ConfigDBServiceImpl.lambda$getOneByQuery$14(ConfigDBServiceImpl.java:340)
at com.mindarray.db.ConfigDBServiceImpl$$Lambda$279/0x00000008003048a8.handle(Unknown Source)
at com.mindarray.db.ConfigDBServiceImpl.lambda$get$12(ConfigDBServiceImpl.java:275)
at com.mindarray.db.ConfigDBServiceImpl$$Lambda$281/0x0000000800304cf8.handle(Unknown Source)
at io.vertx.core.impl.future.FutureImpl$3.onSuccess(FutureImpl.java:141)
at io.vertx.core.impl.future.FutureBase.lambda$emitSuccess$0(FutureBase.java:54)
at io.vertx.core.impl.future.FutureBase$$Lambda$224/0x00000008002e58c0.run(Unknown Source)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:167)
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:470)
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:569)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.run(Unknown Source)
java.lang.Thread.State: RUNNABLE
at com.fasterxml.jackson.core.json.ReaderBasedJsonParser.getText(ReaderBasedJsonParser.java:322)
at com.fasterxml.jackson.databind.deser.std.UntypedObjectDeserializerNR.deserialize(UntypedObjectDeserializerNR.java:82)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer._readAndBindStringKeyMap(MapDeserializer.java:623)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:449)
at com.fasterxml.jackson.databind.deser.std.MapDeserializer.deserialize(MapDeserializer.java:32)
at com.fasterxml.jackson.databind.deser.DefaultDeserializationContext.readRootValue(DefaultDeserializationContext.java:323)
at com.fasterxml.jackson.databind.ObjectMapper._readValue(ObjectMapper.java:4706)
at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:2879)
at io.vertx.core.json.jackson.DatabindCodec.fromParser(DatabindCodec.java:126)
at io.vertx.core.json.jackson.DatabindCodec.fromString(DatabindCodec.java:90)
at io.vertx.core.json.JsonObject.fromJson(JsonObject.java:1250)
at io.vertx.core.json.JsonObject.(JsonObject.java:51)
at com.mindarray.db.ConfigDBServiceImpl.lambda$get$9(ConfigDBServiceImpl.java:251)
at com.mindarray.db.ConfigDBServiceImpl$$Lambda$2209/0x0000000800670900.accept(Unknown Source)
at [email protected]/java.util.concurrent.ConcurrentMap.forEach(Unknown Source)
at com.mindarray.db.ConfigDBServiceImpl.lambda$get$11(ConfigDBServiceImpl.java:249)
at com.mindarray.db.ConfigDBServiceImpl$$Lambda$280/0x0000000800304ad0.handle(Unknown Source)
at io.vertx.core.impl.ContextBase.lambda$null$0(ContextBase.java:137)
at io.vertx.core.impl.ContextBase$$Lambda$218/0x00000008002b9cd8.handle(Unknown Source)
at io.vertx.core.impl.ContextInternal.dispatch(ContextInternal.java:264)
at io.vertx.core.impl.ContextBase.lambda$executeBlocking$1(ContextBase.java:135)
at io.vertx.core.impl.ContextBase$$Lambda$216/0x00000008002b9470.run(Unknown Source)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at io.vertx.core.impl.TaskQueue$$Lambda$197/0x00000008002b16e0.run(Unknown Source)
at [email protected]/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at [email protected]/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at [email protected]/java.lang.Thread.run(Unknown Source)
Any help what could be the problem will be highly appreciated..
The text was updated successfully, but these errors were encountered: