@Override public IndexInput openInput(String name, IOContext context) throws IOException { ensureOpen(); try { return new SegmentIndexInput(ofy().load().key(newSegmentKey(name)).safe()); } catch (NotFoundException e) { throw new IOException(name, e); } } /*
public SiteFormStorage(Activity activity, TableMapping baseMapping, QueryExecutor queryExecutor, ActivityLoader activityLoader) { this.activity = activity; this.baseMapping = baseMapping; this.queryExecutor = queryExecutor; this.activityLoader = activityLoader; if(activity.isMigratedToHrd()) { formEntity = Hrd.ofy().load().key(FormEntity.key(activity.getSiteFormClassId())).safe(); } }
private void update(FormSchemaEntity formClassEntity) { FormEntity rootEntity = ofy().load().key(FormEntity.key(formClass)).safe(); // Increment the version counter long newVersion = rootEntity.getVersion() + 1; rootEntity.setVersion(newVersion); rootEntity.setSchemaVersion(newVersion); // Update the schema formClassEntity.setSchema(formClass); formClassEntity.setSchemaVersion(newVersion); ofy().save().entities(rootEntity, formClassEntity); } }