bwu-datagrid - 实现大数据集的延迟加载

时间:2015-03-11 05:30:23

标签: java google-app-engine dart lazy-loading bwu-datagrid

我正在利用Dart中的bwu-grid数据视图实现来实现延迟加载。我的服务器通过cloudendpoint API使用Google App Engine(Java)实现。返回超过1,000行时,如果未设置fetch选项,则会抛出异常。

我目前在数据视图的底部有JQuery的分页。我希望使用jdo's query cursor实现延迟加载,以便在更改页面时加载数据集的特定段。

我查看了dataview类的实现,发现了我可以使用的以下监听器:

  async.Stream<core.PagingInfoChanged> get onBwuPagingInfoChanged =>
      _eventBus.onEvent(core.Events.PAGING_INFO_CHANGED);

实施计划如下:

  1. 查询第一页数据和总行数,使用总行数更新数据网格
  2. 聆听翻页事件
  3. 使用返回数据段的查询游标创建云端点
  4. 将数据段插入网格并刷新数据网格
  5. 我的实施计划如何?在实施这种方式时我还需要考虑什么?是否有任何示例显示bwu-datagrid中的延迟加载支持?任何建议,将不胜感激。

        W 12:06:21.550 com.google.appengine.api.datastore.BaseQueryResultsSource logChunkSizeWarning: This query does not have a chunk size set in FetchOptions and has returned over 1000 results.  If result sets of this size are common for this query, consider setting a chunk size to improve performance.
            To disable this warning set the following system property in appengine-web.xml (the value of the property doesn't matter): 'appengine.datastore.disableChunkSizeWarning'
        E 12:07:19.760 com.google.api.server.spi.SystemService invokeServiceMethod: exception occurred while calling backed method
          javax.jdo.JDODataStoreException: Datastore Failure
            at org.datanucleus.api.jdo.NucleusJDOHelper.getJDOExceptionForNucleusException(NucleusJDOHelper.java:421)
            at org.datanucleus.api.jdo.JDOPersistenceManager.internalClose(JDOPersistenceManager.java:367)
            at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.releasePersistenceManager(JDOPersistenceManagerFactory.java:1106)
            at org.datanucleus.api.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:343)
            at com.sports_tla.MLBMatchEndpoint.listMLBMatch(MLBMatchEndpoint.java:81)
            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:45)
            at com.google.api.server.spi.SystemService.invokeServiceMethod(SystemService.java:359)
            at com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:160)
            at com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:118)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
            at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
            at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
            at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
            at org.mortbay.jetty.Server.handle(Server.java:326)
            at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
            at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
            at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
            at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:437)
            at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:444)
            at com.google.tracing.CurrentContext.runInContext(CurrentContext.java:220)
            at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:308)
            at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:300)
            at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:441)
            at java.lang.Thread.run(Thread.java:724)
          NestedThrowablesStackTrace:
          com.google.appengine.api.datastore.DatastoreFailureException: Unexpected failure
            at com.google.appengine.api.datastore.FutureHelper.getInternal(FutureHelper.java:78)
            at com.google.appengine.api.datastore.FutureHelper.quietGet(FutureHelper.java:62)
            at com.google.appengine.api.datastore.DatastoreServiceImpl.get(DatastoreServiceImpl.java:41)
            at com.google.appengine.datanucleus.WrappedDatastoreService.get(WrappedDatastoreService.java:60)
            at com.google.appengine.datanucleus.FetchFieldManager.lookupOneToOneChild(FetchFieldManager.java:581)
            at com.google.appengine.datanucleus.FetchFieldManager.fetchRelationField(FetchFieldManager.java:541)
            at com.google.appengine.datanucleus.FetchFieldManager.fetchObjectField(FetchFieldManager.java:405)
            at org.datanucleus.state.AbstractStateManager.replacingObjectField(AbstractStateManager.java:2353)
            at com.sports_tla.MLBMatch.jdoReplaceField(MLBMatch.java)
            at com.sports_tla.MLBMatch.jdoReplaceFields(MLBMatch.java)
            at org.datanucleus.state.JDOStateManager.replaceFields(JDOStateManager.java:1935)
            at org.datanucleus.state.JDOStateManager.replaceFields(JDOStateManager.java:1962)
            at com.google.appengine.datanucleus.EntityUtils$1.fetchFields(EntityUtils.java:974)
            at org.datanucleus.state.JDOStateManager.loadFieldValues(JDOStateManager.java:764)
            at org.datanucleus.state.JDOStateManager.initialiseForHollow(JDOStateManager.java:205)
            at org.datanucleus.state.StateManagerFactory.newForHollowPopulated(StateManagerFactory.java:89)
            at org.datanucleus.state.ObjectProviderFactory.newForHollowPopulated(ObjectProviderFactory.java:75)
            at org.datanucleus.ObjectManagerImpl.findObject(ObjectManagerImpl.java:2882)
            at com.google.appengine.datanucleus.EntityUtils.entityToPojo(EntityUtils.java:1014)
            at com.google.appengine.datanucleus.query.DatastoreQuery$2.apply(DatastoreQuery.java:229)
            at com.google.appengine.datanucleus.query.DatastoreQuery$2.apply(DatastoreQuery.java:226)
            at com.google.appengine.datanucleus.query.LazyResult.resolveNext(LazyResult.java:96)
            at com.google.appengine.datanucleus.query.LazyResult.resolveAll(LazyResult.java:121)
            at com.google.appengine.datanucleus.query.StreamingQueryResult.closingConnection(StreamingQueryResult.java:90)
            at org.datanucleus.store.query.AbstractQueryResult.disconnect(AbstractQueryResult.java:108)
            at com.google.appengine.datanucleus.query.StreamingQueryResult.disconnect(StreamingQueryResult.java:78)
            at com.google.appengine.datanucleus.query.JDOQLQuery$1.managedConnectionPreClose(JDOQLQuery.java:199)
            at com.google.appengine.datanucleus.DatastoreConnectionFactoryImpl$DatastoreManagedConnection.close(DatastoreConnectionFactoryImpl.java:147)
            at org.datanucleus.store.connection.ConnectionManagerImpl.closeAllConnections(ConnectionManagerImpl.java:181)
            at org.datanucleus.store.AbstractStoreManager$1.preClose(AbstractStoreManager.java:260)
            at org.datanucleus.ObjectManagerImpl.close(ObjectManagerImpl.java:1112)
            at org.datanucleus.api.jdo.JDOPersistenceManager.internalClose(JDOPersistenceManager.java:359)
            at org.datanucleus.api.jdo.JDOPersistenceManagerFactory.releasePersistenceManager(JDOPersistenceManagerFactory.java:1106)
            at org.datanucleus.api.jdo.JDOPersistenceManager.close(JDOPersistenceManager.java:343)
            at com.sports_tla.MLBMatchEndpoint.listMLBMatch(MLBMatchEndpoint.java:81)
            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:45)
            at com.google.api.server.spi.SystemService.invokeServiceMethod(SystemService.java:359)
            at com.google.api.server.spi.SystemServiceServlet.execute(SystemServiceServlet.java:160)
            at com.google.api.server.spi.SystemServiceServlet.doPost(SystemServiceServlet.java:118)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
            at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
            at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
            at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
            at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
            at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
            at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
          <continued in next message>
    

0 个答案:

没有答案