Esempio n. 1
0
 public Collection<DynamicRecord> allocateFrom(SchemaRule rule) {
   RecordSerializer serializer = new RecordSerializer();
   serializer = serializer.append(rule);
   Collection<DynamicRecord> records = new ArrayList<>();
   allocateRecordsFromBytes(
       records, serializer.serialize(), IteratorUtil.iterator(forceGetRecord(rule.getId())), this);
   return records;
 }
 private Collection<DynamicRecord> serialize(
     SchemaRule rule, long id, boolean inUse, boolean created) {
   RecordSerializer serializer = new RecordSerializer();
   serializer = serializer.append(rule);
   DynamicRecord record = new DynamicRecord(id);
   record.setData(serializer.serialize());
   if (created) {
     record.setCreated();
   }
   if (inUse) {
     record.setInUse(true);
   }
   return Arrays.asList(record);
 }