示例#1
0
  private Constraint addEvaluationToAllConstraints(QConEvaluation eval) {

    if (i_constraints.size() == 0) {
      _trans
          .container()
          .classCollection()
          .iterateTopLevelClasses(
              new Visitor4() {
                public void visit(Object obj) {
                  ClassMetadata classMetadata = (ClassMetadata) obj;
                  QConClass qcc = new QConClass(_trans, classMetadata.classReflector());
                  addConstraint(qcc);
                  toConstraint(i_constraints).or(qcc);
                }
              });
    }

    Iterator4 i = iterateConstraints();
    while (i.moveNext()) {
      ((QCon) i.current()).addConstraint(eval);
    }

    // FIXME: should return valid Constraint object
    return null;
  }
 private void debugCheckBuffer(ByteArrayBuffer buffer, FreeSlotNode node) {
   if (!(buffer instanceof StatefulBuffer)) {
     return;
   }
   Transaction trans = ((StatefulBuffer) buffer).transaction();
   if (!(trans.container() instanceof IoAdaptedObjectContainer)) {
     return;
   }
   StatefulBuffer checker = trans.container().getWriter(trans, node._peer._key, node._key);
   checker.read();
   for (int i = 0; i < node._key; i++) {
     if (checker.readByte() != (byte) 'X') {
       System.out.println("!!! Free space corruption at:" + node._peer._key);
       break;
     }
   }
 }
 public RawClassSpec readSpec(Transaction trans, ByteArrayBuffer reader) {
   byte[] nameBytes = readName(trans, reader);
   String className = trans.container().stringIO().read(nameBytes);
   readMetaClassID(reader); // skip
   int ancestorID = reader.readInt();
   reader.incrementOffset(Const4.INT_LENGTH); // index ID
   int numFields = reader.readInt();
   return new RawClassSpec(className, ancestorID, numFields);
 }
示例#4
0
 private ReflectClass reflectClassForClass(Object example) {
   if (example instanceof ReflectClass) {
     return (ReflectClass) example;
   }
   if (example instanceof Class) {
     return _trans.reflector().forClass((Class) example);
   }
   return null;
 }
 public ObjectContainerBase stream() {
   return _transaction.container();
 }
 private ReflectClass reflectorFor(Transaction trans, final Object obj) {
   return trans.container().reflector().forObject(obj);
 }
 public byte[] readName(Transaction trans, ByteArrayBuffer reader) {
   byte[] name = readName(trans.container().stringIO(), reader);
   return name;
 }
示例#8
0
 public void captureQueryResultConfig() {
   final Config4Impl config = _trans.container().config();
   _evaluationMode = config.evaluationMode();
   _prefetchDepth = config.prefetchDepth();
   _prefetchCount = config.prefetchObjectCount();
 }
示例#9
0
 protected ObjectContainerBase stream() {
   return _trans.container();
 }