Examples of LoadContext


Examples of com.alibaba.otter.node.etl.load.loader.LoadContext

        if (index < futures.size()) {// 小于代表有错误,需要对未完成的记录进行cancel操作,对已完成的结果进行收集,做重复录入过滤记录
            for (int errorIndex = 0; errorIndex < futures.size(); errorIndex++) {
                Future future = futures.get(errorIndex);
                if (future.isDone()) {
                    try {
                        LoadContext loadContext = (LoadContext) future.get();

                        if (loadContext instanceof DbLoadContext) {
                            dbInterceptor.error((DbLoadContext) loadContext);// 做一下出错处理,记录到store中
                        }
                    } catch (InterruptedException e) {
                        // ignore
                    } catch (ExecutionException e) {
                        // ignore
                    } catch (Exception e) {
                        logger.error("interceptor process error failed", e);
                    }

                } else {
                    future.cancel(true); // 对未完成的进行取消
                }
            }
        } else {
            for (int i = 0; i < futures.size(); i++) {// 收集一下正确处理完成的结果
                Future future = futures.get(i);
                try {
                    LoadContext loadContext = (LoadContext) future.get();

                    if (loadContext instanceof DbLoadContext) {
                        processedContexts.add((DbLoadContext) loadContext);
                    }
                } catch (InterruptedException e) {
View Full Code Here

Examples of com.googlecode.objectify.impl.translate.LoadContext

  /** */
  public ProjectionIterator(QueryResultIterator<Entity> base, LoadEngine loadEngine) {
    super(base);
    this.loadEngine = loadEngine;
    this.ctx = new LoadContext(loadEngine);
  }
View Full Code Here

Examples of com.googlecode.objectify.impl.translate.LoadContext

   * @see com.googlecode.objectify.Objectify#toPojo(com.google.appengine.api.datastore.Entity)
   */
  @Override
  public <T> T fromEntity(Entity entity) {
    LoadEngine engine = createLoadEngine();
    return engine.load(entity, new LoadContext(engine));
  }
View Full Code Here

Examples of com.googlecode.objectify.impl.translate.LoadContext

      /** */
      @Override
      public Map<Key<?>, Object> nowUncached() {
        Map<Key<?>, Object> result = new HashMap<>(raw.now().size() * 2);

        ctx = new LoadContext(LoadEngine.this);

        for (Entity ent: raw.now().values()) {
          Key<?> key = Key.create(ent.getKey());
          Object entity = load(ent, ctx);
          result.put(key, entity);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.