Phoenix create SecondaryIndex timeout - timeout

I'm new to Phoenix and encountered a problem. Firstly, I created a table with 30000000 records by java on Phoenix. Then, I want to create a phoenix global secondIndex to the table. But, when the program runed for 10 minutes, the java client throws SQLTimeoutException. I don't know why, Please help me.
java.sql.SQLTimeoutException: Operation timed out.
at org.apache.phoenix.exception.SQLExceptionCode$15.newException(SQLExceptionCode.java:376)
at org.apache.phoenix.exception.SQLExceptionInfo.buildException(SQLExceptionInfo.java:145)
at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:804)
at org.apache.phoenix.iterate.BaseResultIterators.getIterators(BaseResultIterators.java:720)
at org.apache.phoenix.iterate.RoundRobinResultIterator.getIterators(RoundRobinResultIterator.java:176)
at org.apache.phoenix.iterate.RoundRobinResultIterator.next(RoundRobinResultIterator.java:91)
at org.apache.phoenix.compile.UpsertCompiler$2.execute(UpsertCompiler.java:810)
at org.apache.phoenix.compile.DelegateMutationPlan.execute(DelegateMutationPlan.java:31)
at org.apache.phoenix.compile.PostIndexDDLCompiler$1.execute(PostIndexDDLCompiler.java:124)
at org.apache.phoenix.query.ConnectionQueryServicesImpl.updateData(ConnectionQueryServicesImpl.java:2805)
at org.apache.phoenix.schema.MetaDataClient.buildIndex(MetaDataClient.java:1153)
at org.apache.phoenix.schema.MetaDataClient.createIndex(MetaDataClient.java:1462)
at org.apache.phoenix.compile.CreateIndexCompiler$1.execute(CreateIndexCompiler.java:85)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:340)
at org.apache.phoenix.jdbc.PhoenixStatement$2.call(PhoenixStatement.java:328)
at org.apache.phoenix.call.CallRunner.run(CallRunner.java:53)
at org.apache.phoenix.jdbc.PhoenixStatement.executeMutation(PhoenixStatement.java:326)
at org.apache.phoenix.jdbc.PhoenixStatement.executeUpdate(PhoenixStatement.java:1369)
at cc.xidian.PhoenixOperation.PhoenixSQLOperation.createSecondIndexHintForGeoHashValueLongOfTable(PhoenixSQLOperation.java:1713)
at cc.xidian.MainTest.GeoHashMainTest.main(GeoHashMainTest.java:59)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
CreateSecondIndex-Time: 602708

Try creating the index using the async option.

Related

Issue with registration of java twelvemonkeys registration for Deeplearning app

I am trying to register for a servlet the following and getting an exception. The code is:
static {
IIORegistry registry = IIORegistry.getDefaultInstance();
registry.registerServiceProvider(new com.twelvemonkeys.servlet.image.IIOProviderContextListener());
registry.registerServiceProvider(new com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageReaderSpi());
registry.registerServiceProvider(new com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriterSpi());
}
I am getting the following exception thrown. Funny thing is I only am using the read not the write.
I am using the 3.6 version of twelvemonkeys.
Thanks for any hints!
Exception in thread "main" java.lang.NoSuchMethodError: com.twelvemonkeys.imageio.util.IIOUtil.lookupProviderByName(Ljavax/imageio/spi/ServiceRegistry;Ljava/lang/String;Ljava/lang/Class;)Ljava/lang/Object;
at com.twelvemonkeys.imageio.plugins.jpeg.JPEGImageWriterSpi.onRegistration(JPEGImageWriterSpi.java:82)
at javax.imageio.spi.SubRegistry.registerServiceProvider(Unknown Source)
at javax.imageio.spi.ServiceRegistry.registerServiceProvider(Unknown Source)
at javax.imageio.spi.IIORegistry$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.imageio.spi.IIORegistry.registerInstalledProviders(Unknown Source)
at javax.imageio.spi.IIORegistry.registerStandardSpis(Unknown Source)
at javax.imageio.spi.IIORegistry.<init>(Unknown Source)
at javax.imageio.spi.IIORegistry.getDefaultInstance(Unknown Source)
at deeplearningtest.test.<clinit>(test.java:32)
Ok, I solved the problem. I went to https://github.com/haraldk/TwelveMonkeys#manual-dependency-example and I re-downloaded all the jars mentioned in the article making sure I paid close attention to the versions to make sure 3.6 was selected since 3.6 is not shown as part of the jar name (which I liked). Once I restarted eclipse I got past that problem.
Many thanks haraldK!

Processing Presto ResultSet in Java: 'SQLException: Not on a valid row'

My Presto plugin has two components:
An EventListener that logs stats of queries made to Presto
Some UDFs for hashing (MD5, SHA1) common datatypes (varchar, long) and returning result as varchar
I've already done:
Integration-test (mvn verify) of query-logging component
Unit-test of hashing UDFs
In integration test of UDF component, I'm tyring to assert value returned by my UDF by firing a query
Connection connection = DriverManager.getConnection(PRESTO_URL, PRESTO_USER, PRESTO_PASSWORD);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT SHA1(9223372036854775807) AS hash");
assertEquals("458B642B137E2C76E0B746C6FA43E64C3D4C47F1", resultSet.getString("hash"));
This gives following stack-trace (PrestoResultSet.checkValidRow)
NOTE: ExtendedHashFunctionsTestIT.java:39 line is the one containing resultSet.getString(..)
java.sql.SQLException: Not on a valid row
at com.facebook.presto.jdbc.PrestoResultSet.checkValidRow(PrestoResultSet.java:1658)
at com.facebook.presto.jdbc.PrestoResultSet.column(PrestoResultSet.java:1690)
at com.facebook.presto.jdbc.PrestoResultSet.getString(PrestoResultSet.java:370)
at com.company.plugin.it.udfs.scalar.hash.ExtendedHashFunctionsTestIT.testBody(ExtendedHashFunctionsTestIT.java:39)
at com.company.plugin.it.AbstractIntegrationTest.test(AbstractIntegrationTest.java:77)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:85)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:639)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:816)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1124)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:108)
at org.testng.TestRunner.privateRun(TestRunner.java:774)
at org.testng.TestRunner.run(TestRunner.java:624)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:359)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:354)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:312)
at org.testng.SuiteRunner.run(SuiteRunner.java:261)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1191)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1116)
at org.testng.TestNG.run(TestNG.java:1024)
at org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:62)
at org.apache.maven.surefire.testng.TestNGDirectoryTestSuite.execute(TestNGDirectoryTestSuite.java:141)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
I'm perplexed because error occurs only when I try to access ResultSet; commenting out the assertEquals(..) statement lets the test run successfully.
What's even more disturbing is that stack-trace is same for virtually any query:
SELECT 'some_string' AS some_alias
SHOW SCHEMAS
I'm using Spotify's dockerfile-maven-plugin for the tests. I've put up relevant files in this GitHub Gist
ExtendedHashFunctionsTestIT.java (simplified integration-test file)
pom.xml
Dockerfile
It laments me to think that the mistake that ate up my 2 days was this
Connection connection = DriverManager.getConnection(PRESTO_URL, PRESTO_USER, PRESTO_PASSWORD);
Statement statement = connection.createStatement();
ResultSet resultSet = statement.executeQuery("SELECT SHA1(9223372036854775807) AS hash");
resultSet.next();
assertEquals("458B642B137E2C76E0B746C6FA43E64C3D4C47F1", resultSet.getString("hash"));
That 4th line: I had missed resultSet.next() prior to resultSet.getString(..) :-(

Neo4j 3.1.2 Database has encountered some p*oblem, please perform necessary action (tx recovery/restart)

I have moved to Neo4j 3.1.2 and already a few times I have encountered the following database issue with no any changes in my application:
Caused by: java.lang.RuntimeException: org.neo4j.ogm.exception.TransactionException: Database has encountered some problem, please perform necessary action (tx recovery/restart)
at org.neo4j.ogm.drivers.bolt.request.BoltRequest.executeRequest(BoltRequest.java:175)
at org.neo4j.ogm.drivers.bolt.request.BoltRequest.execute(BoltRequest.java:89)
at org.neo4j.ogm.autoindex.AutoIndexManager.assertIndexes(AutoIndexManager.java:170)
at org.neo4j.ogm.autoindex.AutoIndexManager.build(AutoIndexManager.java:92)
at org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:45)
at org.neo4j.ogm.session.SessionFactory.<init>(SessionFactory.java:62)
at com.example.domain.api.configuration.Neo4jConfig.sessionFactory(Neo4jConfig.java:26)
at com.example.domain.api.configuration.Neo4jConfig$$EnhancerBySpringCGLIB$$93871c91.CGLIB$sessionFactory$0(<generated>)
at com.example.domain.api.configuration.Neo4jConfig$$EnhancerBySpringCGLIB$$93871c91$$FastClassBySpringCGLIB$$8bc180c.invoke(<generated>)
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:228)
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:358)
at com.example.domain.api.configuration.Neo4jConfig$$EnhancerBySpringCGLIB$$93871c91.sessionFactory(<generated>)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:162)
... 131 common frames omitted
What can be a reason of this ?
UPDATED
This is my Neo4j database logs
Oh, this time this was caused by a known (although considered very rare) issue:
org.neo4j.graphdb.TransactionFailureException: Database has encountered some problem, please perform necessary action (tx recovery/restart)
at org.neo4j.kernel.impl.factory.ClassicCoreSPI.beginTransaction(ClassicCoreSPI.java:181)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransactionInternal(GraphDatabaseFacade.java:578)
at org.neo4j.kernel.impl.factory.GraphDatabaseFacade.beginTransaction(GraphDatabaseFacade.java:383)
at org.neo4j.bolt.v1.runtime.TransactionStateMachineSPI.beginTransaction(TransactionStateMachineSPI.java:95)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$1.run(TransactionStateMachine.java:184)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine.run(TransactionStateMachine.java:77)
at org.neo4j.bolt.v1.runtime.BoltStateMachine$State$2.run(BoltStateMachine.java:396)
at org.neo4j.bolt.v1.runtime.BoltStateMachine.run(BoltStateMachine.java:196)
at org.neo4j.bolt.v1.messaging.BoltMessageRouter.lambda$onRun$3(BoltMessageRouter.java:80)
at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.execute(RunnableBoltWorker.java:135)
at org.neo4j.bolt.v1.runtime.concurrent.RunnableBoltWorker.run(RunnableBoltWorker.java:89)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.neo4j.kernel.api.exceptions.TransactionFailureException: Database has encountered some problem, please perform necessary action (tx recovery/restart)
at sun.reflect.GeneratedConstructorAccessor46.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.neo4j.kernel.internal.DatabaseHealth.assertHealthy(DatabaseHealth.java:62)
at org.neo4j.kernel.impl.api.Kernel.newTransaction(Kernel.java:99)
at org.neo4j.kernel.impl.factory.ClassicCoreSPI.beginTransaction(ClassicCoreSPI.java:173)
... 11 more
Caused by: java.lang.IllegalStateException: Concurrent drop() while updates have not completed
at org.neo4j.kernel.impl.api.index.ContractCheckingIndexProxy.ensureNoOpenCalls(ContractCheckingIndexProxy.java:187)
at org.neo4j.kernel.impl.api.index.ContractCheckingIndexProxy.drop(ContractCheckingIndexProxy.java:144)
at org.neo4j.kernel.impl.api.index.IndexingService.dropIndex(IndexingService.java:611)
at org.neo4j.kernel.impl.transaction.command.IndexBatchTransactionApplier$SingleTransactionApplier.visitSchemaRuleCommand(IndexBatchTransactionApplier.java:248)
at org.neo4j.kernel.impl.transaction.command.Command$SchemaRuleCommand.handle(Command.java:645)
at org.neo4j.kernel.impl.api.TransactionApplierFacade.visit(TransactionApplierFacade.java:61)
at org.neo4j.kernel.impl.api.TransactionApplierFacade.visit(TransactionApplierFacade.java:35)
at org.neo4j.kernel.impl.transaction.log.PhysicalTransactionRepresentation.accept(PhysicalTransactionRepresentation.java:69)
at org.neo4j.kernel.impl.api.TransactionToApply.accept(TransactionToApply.java:111)
at org.neo4j.kernel.impl.storageengine.impl.recordstorage.RecordStorageEngine.apply(RecordStorageEngine.java:349)
at org.neo4j.kernel.impl.api.TransactionRepresentationCommitProcess.applyToStore(TransactionRepresentationCommitProcess.java:78)
at org.neo4j.kernel.impl.api.TransactionRepresentationCommitProcess.commit(TransactionRepresentationCommitProcess.java:51)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.commit(KernelTransactionImplementation.java:608)
at org.neo4j.kernel.impl.api.KernelTransactionImplementation.closeTransaction(KernelTransactionImplementation.java:484)
at org.neo4j.kernel.api.KernelTransaction.close(KernelTransaction.java:135)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State.closeTransaction(TransactionStateMachine.java:325)
at org.neo4j.bolt.v1.runtime.TransactionStateMachine$State$2.run(TransactionStateMachine.java:229)
... 7 more
Ideally it will be fixed soon. And I'm not sure how to get out of it w/o restarting server.

Could not use POST method with Feign

im trying to write wrapper for stockfigher game api, just to learn how feign works and I have issues with very first POST method:
#RequestMapping(method = RequestMethod.POST, value = "/venues/KHEX/stocks/LMC/orders")
void newOrderForAStock(String order);
whenever I try to call it, I get exception:
Caused by: feign.RetryableException: cannot retry due to redirection, in streaming mode executing POST https://api.stockfighter.io/ob/api//venues/KHEX/stocks/LMC/orders
at feign.FeignException.errorExecuting(FeignException.java:56)
at feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:97)
at feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:71)
at feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:94)
at com.sun.proxy.$Proxy50.newOrderForAStock(Unknown Source)
at karolik.michal.stockfighter.runner.TestIt.buyFirst(TestIt.java:45)
at karolik.michal.stockfighter.runner.TestIt.runIt(TestIt.java:32)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 22 common frames omitted
is there any way to tweak it?
Your order needs to be #RequestParam("order") String order

I tried using AppiumDriver.tap() with parameters but when it execute it throws server side error

org.openqa.selenium.WebDriverException An unknown server-side error occurred while processing the command. (WARNING: The server did not provide any stacktrace information)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:605)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at io.appium.java_client.AppiumDriver.performTouchAction(AppiumDriver.java:297)
at io.appium.java_client.MultiTouchAction.perform(MultiTouchAction.java:74)
at io.appium.java_client.AppiumDriver.tap(AppiumDriver.java:338)
at allpages.General.swipeLeft(General.java:44)
at test.testappandroid.eVerify(testappandroid.java:152)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1224)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1149)
at org.testng.TestNG.run(TestNG.java:1057)
at org.testng.remote.RemoteTestNG.run(RemoteTestNG.java:111)
at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:204)
at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:175)
Try typing adb devices into the console, is the device listed.
For anymore help please can you post your testng.xml, your test script and you grid configurations (if you are using selenium grid).
It seems like you are experiencing this issue
The developers recommend:
Make sure you are in a native view
Use mobile: tap which uses the click() method
If none of this helps it seems as if this is an open bug, keep and eye on the issue thread linked above and to get around this problem try to use the click method instead of tap.
Thanks,
Liam
I found the reason for my problem.
The error for me is because i missed to use "#Test" annotation in my code where i was using swipe function.
thanks

Resources