org.teiid.logging.LogManager.logError()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(104)

本文整理了Java中org.teiid.logging.LogManager.logError()方法的一些代码示例,展示了LogManager.logError()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。LogManager.logError()方法的具体详情如下:
包路径:org.teiid.logging.LogManager
类名称:LogManager
方法名:logError

LogManager.logError介绍

[英]Send an error message to the log. Error messages are generally used to record unexpected problems, or errors that are not critical in nature and from which the system can automatically recover.

Only if the log manager is configured to send such messages to the destination will the message be recorded.
[中]

代码示例

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
protected synchronized void done() {
  for (CompletionListener<T> listener : this.completionListeners) {
    try {
      listener.onCompletion(this);
    } catch (Throwable t) {
      LogManager.logError(LogConstants.CTX_DQP, t, "Uncaught throwable from completion listener"); //$NON-NLS-1$
    }
  }
  completionListeners.clear();
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
protected void afterExecute(Runnable r, Throwable t) {
  if (t != null) {
    LogManager.logError(LogConstants.CTX_RUNTIME, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021));
  }
}

代码示例来源:origin: org.teiid/teiid-engine

@Override
protected synchronized void done() {
  for (CompletionListener<T> listener : this.completionListeners) {
    try {
      listener.onCompletion(this);
    } catch (Throwable t) {
      LogManager.logError(LogConstants.CTX_DQP, t, "Uncaught throwable from completion listener"); //$NON-NLS-1$
    }
  }
  completionListeners.clear();
}

代码示例来源:origin: teiid/teiid

@Override
protected synchronized void done() {
  for (CompletionListener<T> listener : this.completionListeners) {
    try {
      listener.onCompletion(this);
    } catch (Throwable t) {
      LogManager.logError(LogConstants.CTX_DQP, t, "Uncaught throwable from completion listener"); //$NON-NLS-1$
    }
  }
  completionListeners.clear();
}

代码示例来源:origin: org.teiid/teiid-engine

@Override
protected void afterExecute(Runnable r, Throwable t) {
  if (t != null) {
    LogManager.logError(LogConstants.CTX_RUNTIME, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021));
  }
}

代码示例来源:origin: teiid/teiid

@Override
protected void afterExecute(Runnable r, Throwable t) {
  if (t != null) {
    LogManager.logError(LogConstants.CTX_RUNTIME, t, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30021));
  }
}

代码示例来源:origin: teiid/teiid

@Override
  public void run() {
    try {
      RequestWorkItem wi = workItemRef.get();
      if (wi != null) {
        String reason = QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, finalTimeout);
        wi.requestCancel(reason);
      }
    } catch (TeiidComponentException e) {
      LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018));
    }
  }
}, timeout));

代码示例来源:origin: org.teiid/teiid-engine

@Override
  public void run() {
    try {
      RequestWorkItem wi = workItemRef.get();
      if (wi != null) {
        String reason = QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, finalTimeout);
        wi.requestCancel(reason);
      }
    } catch (TeiidComponentException e) {
      LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018));
    }
  }
}, timeout));

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
  public void run() {
    try {
      RequestWorkItem wi = workItemRef.get();
      if (wi != null) {
        LogManager.logInfo(LogConstants.CTX_DQP, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID31096, wi.requestID, finalTimeout));
        wi.requestCancel();
      }
    } catch (TeiidComponentException e) {
      LogManager.logError(LogConstants.CTX_DQP, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30018));
    }
  }
}, timeout));

代码示例来源:origin: org.teiid/teiid-runtime

@Override
public void updateMatViewRow(String vdbName, String vdbVersion, String schema,
    String viewName, List<?> tuple, boolean delete) {
  VDBMetaData metadata = getVdbRepository().getLiveVDB(vdbName, vdbVersion);
  if (metadata != null) {
    GlobalTableStore gts = metadata.getAttachment(GlobalTableStore.class);
    if (gts != null) {
      try {
        gts.updateMatViewRow((RelationalPlanner.MAT_PREFIX + schema + '.' + viewName).toUpperCase(), tuple, delete);
      } catch (TeiidComponentException e) {
        LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40013, "updateMatViewRow")); //$NON-NLS-1$
      }
    }
  }
}

代码示例来源:origin: org.teiid/teiid-runtime

@Override
public void removed(String name, CompositeVDB vdb) {
  for(EventListener el:EventDistributorImpl.this.listeners) {
    try {
      el.vdbUndeployed(name, vdb.getVDB().getVersion());
    } catch (Exception e) {
      LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40148, "undeployed", vdb.getVDBKey())); //$NON-NLS-1$
    }
  }
}
@Override

代码示例来源:origin: org.teiid/teiid-runtime

@Override
public void added(String name, CompositeVDB vdb) {
  for(EventListener el:EventDistributorImpl.this.listeners) {
    try {
      el.vdbDeployed(name, vdb.getVDB().getVersion());
    } catch (Exception e) {
      LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40148, "deployed", vdb.getVDBKey())); //$NON-NLS-1$
    }
  }
}
@Override

代码示例来源:origin: org.teiid/teiid-runtime

private Serializable processException(Throwable e, String context) {
  if (context == null) {
    context = LogConstants.CTX_TRANSPORT;
  }
  // Case 5558: Differentiate between system level errors and
  // processing errors. Only log system level errors as errors,
  // log the processing errors as warnings only
  if (e instanceof TeiidProcessingException) {
    logProcessingException(e, context);
  } else if (e instanceof AdminProcessingException) {
    logProcessingException(e, context);
  } else {
    LogManager.logError(context, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40017, this.socketClientInstance.getWorkContext().getSessionId()));
  }
  return new ExceptionHolder(e);
}

代码示例来源:origin: org.teiid/teiid-runtime

public static GlobalTableStore createInstance(CompositeVDB vdb, BufferManager bufferManager, ObjectReplicator replicator) {
  VDBMetaData vdbMetadata = vdb.getVDB();
  QueryMetadataInterface metadata = vdbMetadata.getAttachment(TransformationMetadata.class);
  GlobalTableStore gts = new GlobalTableStoreImpl(bufferManager, vdbMetadata, metadata);
  if (replicator != null) {
    try {
      gts = replicator.replicate(vdbMetadata.getFullName(), GlobalTableStore.class, gts, 300000);
    } catch (Exception e) {
      LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40088, gts));
    }
  }    
  if (vdb.getChildren() == null) {
    return gts;
  }
  TreeMap<String, GlobalTableStore> stores = new TreeMap<String, GlobalTableStore>(String.CASE_INSENSITIVE_ORDER);
  buildStoreMap(vdb, stores);
  return new CompositeGlobalTableStore(stores, gts, metadata);
}

代码示例来源:origin: org.teiid/teiid-runtime

private MetadataStore getODBCMetadataStore() {
  try {
    PgCatalogMetadataStore pg = new PgCatalogMetadataStore(CoreConstants.ODBC_MODEL, getRuntimeTypeMap());
    ValidatorReport report = new ValidatorReport("Function Validation"); //$NON-NLS-1$
    FunctionMetadataValidator.validateFunctionMethods(pg.getSchema().getFunctions().values(), report);
    if(report.hasItems()) {
      throw new MetadataException(report.getFailureMessage());
    }
    return pg.asMetadataStore();
  } catch (MetadataException e) {
    this.odbcException = e;
    LogManager.logError(LogConstants.CTX_DQP, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40002));
  }
  return null;
}

代码示例来源:origin: teiid/teiid

@Override
protected void afterCompletion(boolean success) throws TeiidComponentException {
  if (!success && upsertUndoLog != null) {
    upsertUndoLog.setFinal(true);
    TupleBufferTupleSource undoTs = upsertUndoLog.createIndexedTupleSource();
    undoTs.setReverse(true);
    List<?> tuple = null;
    try {
      while ((tuple = undoTs.nextTuple()) != null) {
        try {
          updateTuple(tuple);
        } catch (TeiidException e) {
          LogManager.logError(LogConstants.CTX_DQP, e, e.getMessage());                               
        }
      }
    } catch (TeiidProcessingException e) {
      //shouldn't happen
      throw new TeiidComponentException(e);
    }
  }
  tree.setBatchInsert(false);
}

代码示例来源:origin: org.jboss.teiid/teiid-engine

@Override
protected void afterCompletion(boolean success) throws TeiidComponentException {
  if (!success && upsertUndoLog != null) {
    upsertUndoLog.setFinal(true);
    TupleBufferTupleSource undoTs = upsertUndoLog.createIndexedTupleSource();
    undoTs.setReverse(true);
    List<?> tuple = null;
    try {
      while ((tuple = undoTs.nextTuple()) != null) {
        try {
          updateTuple(tuple);
        } catch (TeiidException e) {
          LogManager.logError(LogConstants.CTX_DQP, e, e.getMessage());                               
        }
      }
    } catch (TeiidProcessingException e) {
      //shouldn't happen
      throw new TeiidComponentException(e);
    }
  }
  tree.setBatchInsert(false);
}

代码示例来源:origin: org.teiid/teiid-engine

@Override
protected void afterCompletion(boolean success) throws TeiidComponentException {
  if (!success && upsertUndoLog != null) {
    upsertUndoLog.setFinal(true);
    TupleBufferTupleSource undoTs = upsertUndoLog.createIndexedTupleSource();
    undoTs.setReverse(true);
    List<?> tuple = null;
    try {
      while ((tuple = undoTs.nextTuple()) != null) {
        try {
          updateTuple(tuple);
        } catch (TeiidException e) {
          LogManager.logError(LogConstants.CTX_DQP, e, e.getMessage());                               
        }
      }
    } catch (TeiidProcessingException e) {
      //shouldn't happen
      throw new TeiidComponentException(e);
    }
  }
  tree.setBatchInsert(false);
}

代码示例来源:origin: org.teiid/teiid-runtime

private void sendErrorResponse(Throwable t) {
  if (t instanceof SQLException) {
    //we are just re-logging an exception raised by the engine
    if (LogManager.isMessageToBeRecorded(LogConstants.CTX_ODBC, MessageLevel.DETAIL)) {
      LogManager.logDetail(LogConstants.CTX_ODBC, t, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40020)); //$NON-NLS-1$ //$NON-NLS-2$
    }
  } else {
    //should be in the odbc layer
    LogManager.logError(LogConstants.CTX_ODBC, t, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40015));
  }
  SQLException e = TeiidSQLException.create(t);
  startMessage('E');
  write('S');
  writeString("ERROR");
  write('C');
  writeString(e.getSQLState());
  write('M');
  writeString(e.getMessage());
  write('D');
  writeString(e.toString());
  write(0);
  sendMessage();
}

代码示例来源:origin: org.teiid/teiid-runtime

@Override
public void finishedDeployment(String name, CompositeVDB vdb) {
  for(EventListener el:EventDistributorImpl.this.listeners) {
    try {					
      if (vdb.getVDB().getStatus().equals(Status.ACTIVE)) {
        el.vdbLoaded(vdb.getVDB());
      }
      else {
        el.vdbLoadFailed(vdb.getVDB());
      }
    } catch (Exception e) {
      LogManager.logError(LogConstants.CTX_RUNTIME, e, RuntimePlugin.Util.gs(RuntimePlugin.Event.TEIID40148, "finished deployment", vdb.getVDBKey())); //$NON-NLS-1$
    }
  }
}
@Override

相关文章