当前位置: 首页>>代码示例>>Java>>正文


Java LogWriter.error方法代码示例

本文整理汇总了Java中com.gemstone.gemfire.LogWriter.error方法的典型用法代码示例。如果您正苦于以下问题:Java LogWriter.error方法的具体用法?Java LogWriter.error怎么用?Java LogWriter.error使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.gemstone.gemfire.LogWriter的用法示例。


在下文中一共展示了LogWriter.error方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: oganizedOperandsSingleRangeJunctionCreation

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Tests the creation of a single RangeJunction if the CompiledJunction only
 * contains same index condition with or without iter operand
 */
private OrganizedOperands oganizedOperandsSingleRangeJunctionCreation(
    int junctionType, CompiledValue[] operandsForCJ, ExecutionContext context) {
  LogWriter logger = CacheUtils.getCache().getLogger();
  OrganizedOperands oo = null;
  try {
    CompiledJunction cj = new CompiledJunction(operandsForCJ, junctionType);
    context.addDependencies(new CompiledID("dummy"), cj
        .computeDependencies(context));
    cj.getPlanInfo(context);
    oo = cj.testOrganizedOperands(context);
    return oo;
  }
  catch (Exception e) {
    logger.error(e);
    fail(e.toString());
  }
  return oo;
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:23,代码来源:CompiledJunctionInternalsTest.java

示例2: testOrganizedOperandsOfSingleRangeJunctionWithNoIterOperandForAND_1

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Tests the functionality of organizedOperands function of a RangeJunction
 * which is an AND with no IterOperand. If the RangeJunction boils down to a
 * single condition which can be evalauted as a CompiledComparison then the
 * filter operand will be a CompiledComparison
 * 
 */
public void testOrganizedOperandsOfSingleRangeJunctionWithNoIterOperandForAND_1() {
  LogWriter logger = CacheUtils.getCache().getLogger();
  try {
    CompiledComparison cv[] = null;
    ExecutionContext context = new QueryExecutionContext(null, CacheUtils
        .getCache());
    this.bindIteratorsAndCreateIndex(context);
    cv = new CompiledComparison[3];
    cv[0] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_LT);
    cv[1] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(5)), OQLLexerTokenTypes.TOK_LE);
    cv[2] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(2)), OQLLexerTokenTypes.TOK_LT);

    OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
        OQLLexerTokenTypes.LITERAL_and, cv, context);
    assertNotNull("OrganizedOperand object is null", oo);
    assertTrue(
        "Filter Openad of OrganizedOperand is not of type RangeJunction",
        oo.filterOperand instanceof RangeJunction);
    RangeJunction rj = (RangeJunction)oo.filterOperand;
    assertEquals(cv.length, rj.getOperands().size());
    OrganizedOperands oo1 = rj.organizeOperands(context);
    assertNotNull(oo1);
    assertNull(oo1.iterateOperand);
    assertNotNull(oo1.filterOperand);
    assertEquals(oo1.filterOperand, cv[2]);

  }
  catch (Exception e) {
    logger.error(e);
    fail(e.toString());
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:46,代码来源:CompiledJunctionInternalsTest.java

示例3: testOrganizedOperandsOfSingleRangeJunctionWithNoIterOperandForAND_2

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Tests the functionality of organizedOperands function of a RangeJunction
 * which is an AND with no IterOperand but where the operator needs
 * reflection. as the condition is Key > Path ( which means Path less than
 * Key) If the RangeJunction boils down toa single condition which can be
 * evalauted as a CompiledComparison then the filter operand will be a
 * CompiledComparison
 * 
 */
public void testOrganizedOperandsOfSingleRangeJunctionWithNoIterOperandForAND_2() {
  LogWriter logger = CacheUtils.getCache().getLogger();
  try {
    CompiledComparison cv[] = null;
    ExecutionContext context = new QueryExecutionContext(null, CacheUtils
        .getCache());
    this.bindIteratorsAndCreateIndex(context);
    cv = new CompiledComparison[3];
    cv[0] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_LT);
    cv[1] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(5)), OQLLexerTokenTypes.TOK_LE);
    cv[2] = new CompiledComparison(new CompiledLiteral(new Integer(2)),
        new CompiledPath(new CompiledID("p"), "ID"),
        OQLLexerTokenTypes.TOK_GT);

    OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
        OQLLexerTokenTypes.LITERAL_and, cv, context);
    assertNotNull("OrganizedOperand object is null", oo);
    assertTrue(
        "Filter Openad of OrganizedOperand is not of type RangeJunction",
        oo.filterOperand instanceof RangeJunction);
    RangeJunction rj = (RangeJunction)oo.filterOperand;
    assertEquals(cv.length, rj.getOperands().size());
    OrganizedOperands oo1 = rj.organizeOperands(context);
    assertNotNull(oo1);
    assertNull(oo1.iterateOperand);
    assertNotNull(oo1.filterOperand);
    assertEquals(oo1.filterOperand, cv[2]);

  }
  catch (Exception e) {
    logger.error(e);
    fail(e.toString());
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:48,代码来源:CompiledJunctionInternalsTest.java

示例4: testOrganizedOperandsOfSingleRangeJunctionWithIterOperandForAND_1

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Tests the functionality of organizedOperands function of a RangeJunction
 * which is an AND with a IterOperand but where the operator needs reflection.
 * as the condition is Key > Path ( which means Path less than Key) The
 * RangeJunction boils down to a single condition which can be evalauted as a
 * CompiledComparison so the filter operand will be a CompiledComparison. Thus
 * the organizdeOperand's filter operand will be a CompiledComparison while
 * its Iteroperand will be a CompiledComparison
 * 
 */
public void testOrganizedOperandsOfSingleRangeJunctionWithIterOperandForAND_1() {
  LogWriter logger = CacheUtils.getCache().getLogger();
  try {
    CompiledComparison cv[] = null;
    ExecutionContext context = new QueryExecutionContext(null, CacheUtils
        .getCache());
    this.bindIteratorsAndCreateIndex(context);
    cv = new CompiledComparison[4];
    cv[0] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_LT);
    cv[1] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(5)), OQLLexerTokenTypes.TOK_LE);
    cv[2] = new CompiledComparison(new CompiledLiteral(new Integer(2)),
        new CompiledPath(new CompiledID("p"), "ID"),
        OQLLexerTokenTypes.TOK_GT);
    cv[3] = new CompiledComparison(new CompiledLiteral(new Integer(2)),
        new CompiledPath(new CompiledID("p"), "createTime"),
        OQLLexerTokenTypes.TOK_GT);
    OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
        OQLLexerTokenTypes.LITERAL_and, cv, context);
    assertNotNull("OrganizedOperand object is null", oo);
    assertTrue(
        "Filter Openad of OrganizedOperand is not of type RangeJunction",
        oo.filterOperand instanceof RangeJunction);
    RangeJunction rj = (RangeJunction)oo.filterOperand;
    assertEquals(cv.length, rj.getOperands().size());
    OrganizedOperands oo1 = rj.organizeOperands(context);
    assertNotNull(oo1);
    assertEquals(cv[3], oo1.iterateOperand);
    assertEquals(oo1.filterOperand, cv[2]);

  }
  catch (Exception e) {
    logger.error(e);
    fail(e.toString());
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:50,代码来源:CompiledJunctionInternalsTest.java

示例5: _testNotEqualCoupledWithUndefinedAndNotNull

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * If possible , in case where RangeJunction contains something like a != 7
 * and a != undefined & a != null, since undefined & null are not groupable ,
 * the a != 7 is also evaluated individually. In such case, it makes sense not
 * to create an Object of rangeJunction.NotEqualConditionEvaluator for
 * evaluating a !=7 , which however is the case now. May be at some point, we
 * should either try to club null & undefined as a part of
 * RangeJunctionEvaluator or we should not create an object of
 * NotEqualConditionEvaluator.
 * 
 */
public void _testNotEqualCoupledWithUndefinedAndNotNull() {
  LogWriter logger = CacheUtils.getLogger();
  try {
    ExecutionContext context = new QueryExecutionContext(null, CacheUtils
        .getCache());
    this.bindIteratorsAndCreateIndex(context);
    // Case 2 : a != 7 and a != null and a != undefined
    CompiledValue[] cv1 = new CompiledValue[3];
    cv1[0] = new CompiledComparison(new CompiledPath(new CompiledID("p"),
        "ID"), new CompiledLiteral(new Integer(7)), OQLLexerTokenTypes.TOK_NE);
    cv1[1] = new CompiledComparison(new CompiledPath(new CompiledID("p"),
        "ID"), new CompiledLiteral(null), OQLLexerTokenTypes.TOK_NE);
    cv1[2] = new CompiledUndefined(
        new CompiledPath(new CompiledID("p"), "ID"), false);

    OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
        OQLLexerTokenTypes.LITERAL_and, cv1, context);
    assertTrue(
        "Filter Openad of OrganizedOperand is not of type RangeJunction",
        oo.filterOperand instanceof RangeJunction);
    RangeJunction rj = (RangeJunction)oo.filterOperand;
    OrganizedOperands oo1 = rj.organizeOperands(context);
    assertTrue(oo1.filterOperand instanceof GroupJunction);
    CompiledValue[] ops = ((GroupJunction)oo1.filterOperand)._operands;
    assertTrue(cv1[0] == ops[0] || cv1[0] == ops[1] || cv1[0] == ops[2]);
    assertTrue(cv1[1] == ops[0] || cv1[1] == ops[1] || cv1[1] == ops[2]);
    assertTrue(cv1[2] == ops[0] || cv1[2] == ops[1] || cv1[2] == ops[2]);
  }
  catch (Exception e) {
    logger.error(e.toString());
    fail(e.toString());
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:45,代码来源:CompiledJunctionInternalsTest.java

示例6: testOrganizeOpsOfRangeJunctionForNonRangeEvaluatableOperand

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
public void testOrganizeOpsOfRangeJunctionForNonRangeEvaluatableOperand() {

    LogWriter logger = CacheUtils.getLogger();
    try {
      CompiledValue cv[] = null;
      ExecutionContext context = new QueryExecutionContext(null, CacheUtils
          .getCache());
      this.bindIteratorsAndCreateIndex(context);
      // Case 1 : a != null and a != null and a != undefined
      cv = new CompiledValue[3];
      cv[0] = new CompiledComparison(
          new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(null), OQLLexerTokenTypes.TOK_NE);
      cv[1] = new CompiledComparison(
          new CompiledPath(new CompiledID("p"), "ID"),
          new CompiledLiteral(null), OQLLexerTokenTypes.TOK_NE);
      cv[2] = new CompiledUndefined(
          new CompiledPath(new CompiledID("p"), "ID"), false);
      OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
          OQLLexerTokenTypes.LITERAL_and, cv, context);
      assertTrue(
          "Filter Openad of OrganizedOperand is not of type RangeJunction",
          oo.filterOperand instanceof RangeJunction);
      RangeJunction rj = (RangeJunction)oo.filterOperand;
      OrganizedOperands oo1 = rj.organizeOperands(context);
      assertTrue(oo1.filterOperand instanceof GroupJunction);
      CompiledValue[] ops = ((GroupJunction)oo1.filterOperand)._operands;
      assertTrue(ops[0] == cv[0] || ops[0] == cv[1] || ops[0] == cv[2]);
      assertTrue(ops[1] == cv[0] || ops[1] == cv[1] || ops[1] == cv[2]);
      assertTrue(ops[2] == cv[0] || ops[2] == cv[1] || ops[2] == cv[2]);
    }
    catch (Exception e) {
      logger.error(e);
      fail(e.toString());
    }

  }
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:38,代码来源:CompiledJunctionInternalsTest.java

示例7: logStackTrace

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Logs the stack trace for the given Throwable if logger is initialized else
 * prints the stack trace using System.out.
 * 
 * @param level
 *          severity level to log at
 * @param throwable
 *          Throwable to log stack trace for
 * @param message
 *          user friendly error message to show
 */
public static void logStackTrace(int level, Throwable throwable, 
                                 String message) {
  AdminDistributedSystemImpl adminDS = 
                            AdminDistributedSystemImpl.getConnectedInstance();
  LogWriter logWriter = null;

  if (adminDS != null && (logWriter = adminDS.getLogWriter()) != null ) {
    switch (level) {
    case LogWriterImpl.FINEST_LEVEL:
      logWriter.finest(message, throwable);
      break;
    case LogWriterImpl.FINER_LEVEL:
      logWriter.finer(message, throwable);
      break;
    case LogWriterImpl.FINE_LEVEL:
      logWriter.fine(message, throwable);
      break;
    case LogWriterImpl.CONFIG_LEVEL:
      logWriter.config(message, throwable);
      break;
    case LogWriterImpl.INFO_LEVEL:
      logWriter.info(message, throwable);
      break;
    case LogWriterImpl.WARNING_LEVEL:
      logWriter.warning(message, throwable);
      break;
    case LogWriterImpl.ERROR_LEVEL:
      logWriter.error(message, throwable);
      break;
    case LogWriterImpl.SEVERE_LEVEL:
      logWriter.severe(message, throwable);
      break;
    default:
      break;
    }
  } else {
    if (message != null) {
      System.out.println(message);
    }
    if (throwable != null) {
      throwable.printStackTrace();
    }
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:56,代码来源:MBeanUtil.java

示例8: logError

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
private static void logError(String message) {
  LogWriter logger = getLogger();
  if (logger.errorEnabled()) {
    logger.error(message);
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:7,代码来源:ConfigurationUtils.java

示例9: execute

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
@Override
public void execute(FunctionContext context) {
  // Declared here so that it's available when returning a Throwable
  String memberId = "";
  LogWriter logger = null;

  try {
    final Object[] args = (Object[]) context.getArguments();
    final String diskStoreName = (String) args[0];
    final DiskStoreAttributes diskStoreAttrs = (DiskStoreAttributes) args[01];

    GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();

    logger = cache.getLogger();
    DistributedMember member = cache.getDistributedSystem().getDistributedMember();

    memberId = member.getId();
    // If they set a name use it instead
    if (!member.getName().equals("")) {
      memberId = member.getName();
    }
    
    DiskStoreFactory diskStoreFactory = cache.createDiskStoreFactory(diskStoreAttrs);
    diskStoreFactory.create(diskStoreName);
    
    XmlEntity xmlEntity = new XmlEntity(CacheXml.DISK_STORE, "name", diskStoreName);
    context.getResultSender().lastResult(new CliFunctionResult(memberId, xmlEntity, "Success"));
    
  } catch (CacheClosedException cce) {
    context.getResultSender().lastResult(new CliFunctionResult(memberId, false, null));
    
  } catch (VirtualMachineError e) {
    SystemFailure.initiateFailure(e);
    throw e;
    
  } catch (Throwable th) {
    SystemFailure.checkFailure();
    if (logger != null) {
      logger.error("Could not create disk store", th);
    }
    
    context.getResultSender().lastResult(new CliFunctionResult(memberId, th, null));
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:45,代码来源:CreateDiskStoreFunction.java

示例10: execute

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
@Override
public void execute(FunctionContext context) {
  // Declared here so that it's available when returning a Throwable
  String memberId = "";
  LogWriter logger = null;

  try {
    final Object[] args = (Object[]) context.getArguments();
    final String asyncEventQueueId = (String) args[0];
    final int batchSize = (Integer) args[1];
    final boolean persistent = (Boolean) args[2];
    final String diskStoreName = (String) args[3];
    final int maxQueueMemory = (Integer) args[4];
    final String listenerClassName = (String) args[5];
    final Properties listenerProperties = (Properties) args[6];

    GemFireCacheImpl cache = (GemFireCacheImpl) CacheFactory.getAnyInstance();

    logger = cache.getLogger();
    DistributedMember member = cache.getDistributedSystem().getDistributedMember();

    memberId = member.getId();
    // If they set a name use it instead
    if (!member.getName().equals("")) {
      memberId = member.getName();
    }

    AsyncEventQueueFactory asyncEventQueueFactory = cache.createAsyncEventQueueFactory();
    asyncEventQueueFactory.setBatchSize(batchSize);
    asyncEventQueueFactory.setPersistent(persistent);
    asyncEventQueueFactory.setDiskStoreName(diskStoreName);
    asyncEventQueueFactory.setMaximumQueueMemory(maxQueueMemory);

    Object listenerInstance;
    Class listenerClass = InternalDataSerializer.getCachedClass(listenerClassName);
    listenerInstance = listenerClass.newInstance();

    if (listenerProperties != null && !listenerProperties.isEmpty()) {
      if (!(listenerInstance instanceof Declarable)) {
        throw new IllegalArgumentException("Listener properties were provided, but the listener specified does not implement Declarable.");
      }
      
      ((Declarable) listenerInstance).init(listenerProperties);

      Map<Declarable, Properties> declarablesMap = new HashMap<Declarable, Properties>();
      declarablesMap.put((Declarable) listenerInstance, listenerProperties);
      cache.addDeclarableProperties(declarablesMap);
    }

    asyncEventQueueFactory.create(asyncEventQueueId, (AsyncEventListener) listenerInstance);

    XmlEntity xmlEntity = new XmlEntity(CacheXml.ASYNC_EVENT_QUEUE, "id", asyncEventQueueId);
    context.getResultSender().lastResult(new CliFunctionResult(memberId, xmlEntity, "Success"));

  } catch (CacheClosedException cce) {
    context.getResultSender().lastResult(new CliFunctionResult(memberId, false, null));

  } catch (VirtualMachineError e) {
    SystemFailure.initiateFailure(e);
    throw e;
    
  } catch (Throwable th) {
    SystemFailure.checkFailure();
    if (logger != null) {
      logger.error("Could not create disk store", th);
    }

    context.getResultSender().lastResult(new CliFunctionResult(memberId, th, null));
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:71,代码来源:CreateAsyncEventQueueFunction.java

示例11: outputProblem

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
@Override
void outputProblem(String message) {
  LogWriter logWriter = new LocalLogWriter(LogWriterImpl.INFO_LEVEL);
  logWriter.error(message);
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:6,代码来源:PassWithExpectedErrorJUnitTest.java

示例12: logErrorAndRaiseException

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
public static void logErrorAndRaiseException(String message, Throwable e) throws TestException {
  LogWriter logger = Log.getLogWriter();
  logger.error(message, e);
  throw new TestException(message, e);
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:6,代码来源:HydraUtil.java

示例13: testOrganizedOperandsSingleRangeJunctionCreationWithIterOperandForAND

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Tests the creation of a single RangeJunction if the CompiledJunction only
 * contains same index condition and an iter operand for AND
 */
public void testOrganizedOperandsSingleRangeJunctionCreationWithIterOperandForAND() {
  LogWriter logger = CacheUtils.getCache().getLogger();
  try {
    CompiledComparison cv[] = null;
    ExecutionContext context = new QueryExecutionContext(null, CacheUtils
        .getCache());
    this.bindIteratorsAndCreateIndex(context);
    cv = new CompiledComparison[13];
    cv[0] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(2)), OQLLexerTokenTypes.TOK_EQ);
    cv[1] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(5)), OQLLexerTokenTypes.TOK_LE);
    cv[2] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_LT);
    cv[3] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_GT);
    cv[4] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_GE);
    cv[5] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_NE);
    cv[6] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(2)), OQLLexerTokenTypes.TOK_EQ);
    cv[7] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(5)), OQLLexerTokenTypes.TOK_LE);
    cv[8] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_LT);
    cv[9] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_GT);
    cv[10] = new CompiledComparison(new CompiledPath(new CompiledID("p"),
        "ID"), new CompiledLiteral(new Integer(7)), OQLLexerTokenTypes.TOK_GE);
    cv[11] = new CompiledComparison(new CompiledPath(new CompiledID("p"),
        "ID"), new CompiledLiteral(new Integer(7)), OQLLexerTokenTypes.TOK_NE);
    cv[12] = new CompiledComparison(new CompiledPath(new CompiledID("p"),
        "createTime"), new CompiledLiteral(new Long(7)),
        OQLLexerTokenTypes.TOK_NE);

    OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
        OQLLexerTokenTypes.LITERAL_and, cv, context);
    assertNotNull("OrganizedOperand object is null", oo);
    assertTrue(
        "Filter Openad of OrganizedOperand is not of type RangeJunction",
        oo.filterOperand instanceof RangeJunction);
    RangeJunction rj = (RangeJunction)oo.filterOperand;
    assertEquals(cv.length, rj.getOperands().size());
  }
  catch (Exception e) {
    logger.error(e);
    fail(e.toString());
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:65,代码来源:CompiledJunctionInternalsTest.java

示例14: logError

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
public static void logError(String message, Throwable e) {
  LogWriter logger = Log.getLogWriter();
  logger.error(message, e);
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:5,代码来源:HydraUtil.java

示例15: testOrganizedOperandsOfSingleRangeJunctionWithTwoIterOperandsForAND_2

import com.gemstone.gemfire.LogWriter; //导入方法依赖的package包/类
/**
 * Tests the functionality of organizedOperands function of a RangeJunction
 * which is an AND with two IterOperands but where the operator needs
 * reflection. as the condition is Key > Path ( which means Path less than
 * Key) The RangeJunction boils down to a single condition which can be
 * evalauted as a CompiledComparison so the filter operand will be a
 * CompiledComparison. Thus the organizdeOperand's filter operand will be a
 * CompiledComparison while its Iteroperand will be a CompiledJunction
 * 
 */
public void testOrganizedOperandsOfSingleRangeJunctionWithTwoIterOperandsForAND_2() {
  LogWriter logger = CacheUtils.getCache().getLogger();
  try {
    CompiledComparison cv[] = null;
    ExecutionContext context = new QueryExecutionContext(null, CacheUtils
        .getCache());
    this.bindIteratorsAndCreateIndex(context);
    cv = new CompiledComparison[5];
    cv[0] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(7)), OQLLexerTokenTypes.TOK_LT);
    cv[1] = new CompiledComparison(
        new CompiledPath(new CompiledID("p"), "ID"), new CompiledLiteral(
            new Integer(5)), OQLLexerTokenTypes.TOK_LE);
    cv[2] = new CompiledComparison(new CompiledLiteral(new Integer(2)),
        new CompiledPath(new CompiledID("p"), "ID"),
        OQLLexerTokenTypes.TOK_GT);
    cv[3] = new CompiledComparison(new CompiledLiteral(new Integer(2)),
        new CompiledPath(new CompiledID("p"), "createTime"),
        OQLLexerTokenTypes.TOK_GT);
    cv[4] = new CompiledComparison(new CompiledLiteral(new String("xyz")),
        new CompiledPath(new CompiledID("p"), "getPk"),
        OQLLexerTokenTypes.TOK_GT);
    OrganizedOperands oo = this.oganizedOperandsSingleRangeJunctionCreation(
        OQLLexerTokenTypes.LITERAL_and, cv, context);
    assertNotNull("OrganizedOperand object is null", oo);
    assertTrue(
        "Filter Openad of OrganizedOperand is not of type RangeJunction",
        oo.filterOperand instanceof RangeJunction);
    RangeJunction rj = (RangeJunction)oo.filterOperand;
    assertEquals(cv.length, rj.getOperands().size());
    OrganizedOperands oo1 = rj.organizeOperands(context);
    assertNotNull(oo1);
    assertTrue(oo1.iterateOperand instanceof CompiledJunction);
    assertTrue(oo1.iterateOperand.getChildren().size() == 2);
    assertTrue(oo1.iterateOperand.getChildren().get(0) == cv[3]);
    assertTrue(oo1.iterateOperand.getChildren().get(1) == cv[4]);
    assertEquals(oo1.filterOperand, cv[2]);

  }
  catch (Exception e) {
    logger.error(e);
    fail(e.toString());
  }
}
 
开发者ID:gemxd,项目名称:gemfirexd-oss,代码行数:56,代码来源:CompiledJunctionInternalsTest.java


注:本文中的com.gemstone.gemfire.LogWriter.error方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。