Package org.apache.gora.persistency.impl

Examples of org.apache.gora.persistency.impl.StateManagerImpl


      return old;
    } else return new ListGenericArray(size, schema);
  }
 
  public Persistent clone(Persistent persistent, Schema schema) {
    Persistent cloned = persistent.newInstance(new StateManagerImpl());
    List<Field> fields = schema.getFields();
    for(Field field: fields) {
      int pos = field.pos();
      switch(field.schema().getType()) {
        case MAP    :
View Full Code Here


    PersistentBase.registerFields(Metadata.class, _ALL_FIELDS);
  }
  private int version;
  private Map<Utf8,Utf8> data;
  public Metadata() {
    this(new StateManagerImpl());
  }
View Full Code Here

  static {
    PersistentBase.registerFields(TokenDatum.class, _ALL_FIELDS);
  }
  private int count;
  public TokenDatum() {
    this(new StateManagerImpl());
  }
View Full Code Here

  private ByteBuffer content;
  private GenericArray<Utf8> parsedContent;
  private Map<Utf8,Utf8> outlinks;
  private Metadata metadata;
  public WebPage() {
    this(new StateManagerImpl());
  }
View Full Code Here

  private Utf8 name;
  private long dateOfBirth;
  private Utf8 ssn;
  private int salary;
  public Employee() {
    this(new StateManagerImpl());
  }
View Full Code Here

   * Duplicate instance to keep all the objects in memory till flushing.
   * @see org.apache.gora.store.DataStore#put(java.lang.Object, org.apache.gora.persistency.Persistent)
   */
  @Override
  public void put(K key, T value) throws IOException {
    T p = (T) value.newInstance(new StateManagerImpl());
    Schema schema = value.getSchema();
    for (Field field: schema.getFields()) {
      if (value.isDirty(field.pos())) {
        Object fieldValue = value.get(field.pos());
       
        // check if field has a nested structure (map or record)
        Schema fieldSchema = field.schema();
        Type type = fieldSchema.getType();
        switch(type) {
          case RECORD:
            Persistent persistent = (Persistent) fieldValue;
            Persistent newRecord = persistent.newInstance(new StateManagerImpl());
            for (Field member: fieldSchema.getFields()) {
              newRecord.put(member.pos(), persistent.get(member.pos()));
            }
            fieldValue = newRecord;
            break;
View Full Code Here

  }
  private int majorCode;
  private int minorCode;
  private GenericArray<Utf8> args;
  public ParseStatus() {
    this(new StateManagerImpl());
  }
View Full Code Here

  }
  private int code;
  private GenericArray<Utf8> args;
  private long lastModified;
  public ProtocolStatus() {
    this(new StateManagerImpl());
  }
View Full Code Here

  static {
    PersistentBase.registerFields(Host.class, _ALL_FIELDS);
  }

  public Host() {
    this(new StateManagerImpl());
  }
View Full Code Here

  private Map<Utf8,Utf8> outlinks;
  private Map<Utf8,Utf8> inlinks;
  private Map<Utf8,Utf8> markers;
  private Map<Utf8,ByteBuffer> metadata;
  public WebPage() {
    this(new StateManagerImpl());
  }
View Full Code Here

TOP

Related Classes of org.apache.gora.persistency.impl.StateManagerImpl

Copyright © 2018 www.massapicom. 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.