org.teiid.core.util.Assertion.assertTrue()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(7.0k)|赞(0)|评价(0)|浏览(122)

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

Assertion.assertTrue介绍

暂无

代码示例

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

public void reset(int newIndex) {
  Assertion.assertTrue(newIndex < bufs[0].length);
  while (bufferIndex > 0) {
    bufs[bufferIndex--] = null;
  }
  count = index = newIndex;
}

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

public void setProcessingSortRight(boolean processingSortRight) {
  if (processingSortRight && this.processingSortRight == SortOption.ALREADY_SORTED) {
    //it is possible that a delayed open will be called after the parent open
    //for now we'll just throw an assertion
    Assertion.assertTrue(!this.rightSource.open);
    this.processingSortRight = SortOption.SORT;
  }
}

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

public void setProcessingSortLeft(boolean processingSortLeft) {
  if (processingSortLeft && this.processingSortLeft == SortOption.ALREADY_SORTED) {
    //it is possible that a delayed open will be called after the parent open
    //for now we'll just throw an assertion
    Assertion.assertTrue(!this.leftSource.open);
    this.processingSortLeft = SortOption.SORT;
  }
}

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

public void reset(int newIndex) {
  Assertion.assertTrue(newIndex < bufs[0].length);
  while (bufferIndex > 0) {
    bufs[bufferIndex--] = null;
  }
  count = index = newIndex;
}

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

public void setProcessingSortRight(boolean processingSortRight) {
  if (processingSortRight && this.processingSortRight == SortOption.ALREADY_SORTED) {
    //it is possible that a delayed open will be called after the parent open
    //for now we'll just throw an assertion
    Assertion.assertTrue(!this.rightSource.open);
    this.processingSortRight = SortOption.SORT;
  }
}

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

private int getIndex(Expression valueExpression) {
  int index = schema.indexOf(valueExpression);
  Assertion.assertTrue(index != -1);
  return index;
}

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

private int getIndex(Expression valueExpression) {
  int index = schema.indexOf(valueExpression);
  Assertion.assertTrue(index != -1);
  return index;
}

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

void saveBatch(boolean force) throws TeiidComponentException {
  Assertion.assertTrue(!this.isRemoved());
  if (batchBuffer == null || batchBuffer.isEmpty() || (!force && batchBuffer.size() < Math.max(1, batchSize / 32))) {
    return;
  }
  Long mbatch = manager.createManagedBatch(batchBuffer, null, false);
  this.batches.put(rowCount - batchBuffer.size() + 1, mbatch);
  batchBuffer = null;
}

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

void saveBatch(boolean force) throws TeiidComponentException {
  Assertion.assertTrue(!this.isRemoved());
  if (batchBuffer == null || batchBuffer.isEmpty() || (!force && batchBuffer.size() < Math.max(1, batchSize / 32))) {
    return;
  }
  Long mbatch = manager.createManagedBatch(batchBuffer, null, false);
  this.batches.put(rowCount - batchBuffer.size() + 1, mbatch);
  batchBuffer = null;
}

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

public static final SymbolMap createSymbolMap(List<ElementSymbol> virtualElements,
                       List<? extends Expression> mappedCols) {
  Assertion.assertTrue(virtualElements.size() == mappedCols.size());
  SymbolMap symbolMap = new SymbolMap();
  Iterator<ElementSymbol> keyIter = virtualElements.iterator();
  for (Expression symbol : mappedCols) {
    symbolMap.addMapping(keyIter.next(), symbol);
  }
  return symbolMap;
}

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

protected void mergePhase(int rowLimit) throws TeiidComponentException, TeiidProcessingException {
  if (this.activeTupleBuffers.size() > 1) {
    doMerge(rowLimit);
  }
  
  // Close sorted source (all others have been removed)
  Assertion.assertTrue(doneReading);
  activeTupleBuffers.get(0).close();
  activeTupleBuffers.get(0).setForwardOnly(false);
  this.phase = DONE;
  return;
}

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

@Override
public boolean prepare(TupleBufferCache bufferManager) {
  Assertion.assertTrue(!this.results.isForwardOnly());
  bufferManager.distributeTupleBuffer(this.results.getId(), results);
  return true;
}

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

static void rewriteAndEvaluate(Command atomicCommand, Evaluator eval, CommandContext context, QueryMetadataInterface metadata)
    throws TeiidProcessingException, TeiidComponentException {
  try {
    // Defect 16059 - Rewrite the command to replace references, etc. with values.
    Command cmd = QueryRewriter.evaluateAndRewrite(atomicCommand, eval, context, metadata);
    //we don't expect the command to change at this point
    Assertion.assertTrue(cmd == atomicCommand);
  } catch (QueryValidatorException e) {
     throw new TeiidProcessingException(QueryPlugin.Event.TEIID30174, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30174, atomicCommand));
  }
}

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

static void rewriteAndEvaluate(Command atomicCommand, Evaluator eval, CommandContext context, QueryMetadataInterface metadata)
    throws TeiidProcessingException, TeiidComponentException {
  try {
    // Defect 16059 - Rewrite the command to replace references, etc. with values.
    Command cmd = QueryRewriter.evaluateAndRewrite(atomicCommand, eval, context, metadata);
    //we don't expect the command to change at this point
    Assertion.assertTrue(cmd == atomicCommand);
  } catch (QueryValidatorException e) {
     throw new TeiidProcessingException(QueryPlugin.Event.TEIID30174, e, QueryPlugin.Util.gs(QueryPlugin.Event.TEIID30174, atomicCommand));
  }
}

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

public void testAssertTrueboolean() {
  Assertion.assertTrue(true);
  try {
    Assertion.assertTrue(false);
    fail();
  } catch ( AssertionError e ) {
    // expected, but check the message
    final String msg = CorePlugin.Util.getString("Assertion.Assertion_failed"); //$NON-NLS-1$
    assertEquals(msg, e.getMessage());
  }
}

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

/**
 * Request level transaction
 */    
public void commit(TransactionContext context) throws XATransactionException {
  Assertion.assertTrue(context.getTransactionType() == TransactionContext.Scope.REQUEST);
  try {
    commitDirect(context);
  } finally {
    context.setTransaction(null);
    context.setTransactionType(Scope.NONE);
  }
}

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

/**
 * Request level transaction
 */    
public void rollback(TransactionContext context) throws XATransactionException {
  Assertion.assertTrue(context.getTransactionType() == TransactionContext.Scope.REQUEST);
  try {
    rollbackDirect(context);
  } finally {
    context.setTransaction(null);
    context.setTransactionType(Scope.NONE);
  }
}

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

/**
 * Request level transaction
 */    
public void rollback(TransactionContext context) throws XATransactionException {
  Assertion.assertTrue(context.getTransactionType() == TransactionContext.Scope.REQUEST);
  try {
    rollbackDirect(context);
  } finally {
    context.setTransaction(null);
    context.setTransactionType(Scope.NONE);
  }
}

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

/**
 * Request level transaction
 */    
public void commit(TransactionContext context) throws XATransactionException {
  Assertion.assertTrue(context.getTransactionType() == TransactionContext.Scope.REQUEST);
  try {
    commitDirect(context);
  } finally {
    context.setTransaction(null);
    context.setTransactionType(Scope.NONE);
  }
}

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

/**
 * Request level transaction
 */    
public void rollback(TransactionContext context) throws XATransactionException {
  Assertion.assertTrue(context.getTransactionType() == TransactionContext.Scope.REQUEST);
  try {
    rollbackDirect(context);
  } finally {
    context.setTransaction(null);
    context.setTransactionType(Scope.NONE);
  }
}

相关文章