AnsweredAssumed Answered

Problem inserting and or querying documents using OJAI API

Question asked by PETER.EDIKE on Dec 26, 2017
Latest reply on Dec 27, 2017 by cathy

Hello everyone, 

I have been playing around with MapR for some time and So far so good up untill i wanted to test some code against the Hadoop Sandbox (Latest Version).

 

I am trying to insert a document into MapR db. I have set up maprclient on windows and all the relevant Hadoop commands work correctly from the command prompt. However when i try to run the following code, 

 

public void insert(T data) {
    if (data != null) {
        DocumentStore store = connection.getStore(path);
        String documentId = UUID.randomUUID().toString();
        Document document = connection.newDocument(data);
        document.setId(documentId);
        store.insert(document);
    }
}

 

 

I get the following stacktrace

 

com.mapr.db.exceptions.DBException: findAll.next() failed with err code = 95,
at com.mapr.db.exceptions.ExceptionHandler.handle(ExceptionHandler.java:48)
at com.mapr.db.impl.DBDocumentStream.next(DBDocumentStream.java:155)
at com.mapr.db.impl.DBDocumentStream.access$100(DBDocumentStream.java:34)
at com.mapr.db.impl.DBDocumentStream$1.hasNext(DBDocumentStream.java:266)
at com.interswitch.bigdata.common.dataaccess.maprdb.MaprRepository.query(MaprRepository.java:44)
at com.interswitch.bigdata.common.dataaccess.maprdb.MaprKeyValueRepository.update(MaprKeyValueRepository.java:93)
at com.interswitch.bigdata.common.dataaccess.maprdb.MaprKeyValueRepository.update(MaprKeyValueRepository.java:21)
at com.interswitch.bigdata.common.producer.JobRunner.runOneIteration(JobRunner.java:99)
at com.google.common.util.concurrent.AbstractScheduledService$ServiceDelegate$Task.run(AbstractScheduledService.java:188)
at com.google.common.util.concurrent.Callables$4.run(Callables.java:122)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:308)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:294)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.mapr.fs.ErrnoException: scanNext() on '/user/root/maprdb/tables/checkpoint' failed with error: Operation not supported (95).
at com.mapr.fs.Inode.checkError(Inode.java:1823)
at com.mapr.fs.Inode.checkError(Inode.java:1782)
at com.mapr.fs.Inode.scanNext(Inode.java:1550)
at com.mapr.fs.MapRHTable.scanNext(MapRHTable.java:842)
at com.mapr.fs.MapRResultScanner.nextRows(MapRResultScanner.java:58)
at com.mapr.fs.MapRResultScanner.nextRows(MapRResultScanner.java:51)
at com.mapr.fs.MapRResultScanner.nextRow(MapRResultScanner.java:38)
at com.mapr.db.impl.DBDocumentStream.next(DBDocumentStream.java:153)
... 15 more
2017-12-26 10:41:05,5940 ERROR Client fs/client/fileclient/cc/scanner.cc:275 Thread: 52992 Failed scanner initialization for table /user/root/maprdb/tables/checkpoint, Unexpected error: Operation not supported on transport endpoint(95) for fid 2179.33.131334
2017-12-26 10:41:05,5940 ERROR ApiCommon fs/client/fileclient/cc/api_common.cc:362 Thread: 52992 Scanner failed to get 100 rows error = 95
2017-12-26 10:41:21,4357 ERROR ApiCommon fs/client/fileclient/cc/api_common.cc:2759 Thread: 52992 Error in UpdateAndGetResponse for table /user/root/maprdb/tables/checkpoint, error: Operation not supported on transport endpoint(95)

Please is there something I am doing wrong

Outcomes