Exemplo n.º 1
0
 public void ensureHeavy(PropertyBlock block) {
   if (block.getType() == PropertyType.STRING) {
     if (block.isLight()) {
       Collection<DynamicRecord> stringRecords =
           stringPropertyStore.getLightRecords(block.getSingleValueLong());
       for (DynamicRecord stringRecord : stringRecords) {
         stringRecord.setType(PropertyType.STRING.intValue());
         block.addValueRecord(stringRecord);
       }
     }
     for (DynamicRecord stringRecord : block.getValueRecords()) {
       stringPropertyStore.ensureHeavy(stringRecord);
     }
   } else if (block.getType() == PropertyType.ARRAY) {
     if (block.isLight()) {
       Collection<DynamicRecord> arrayRecords =
           arrayPropertyStore.getLightRecords(block.getSingleValueLong());
       for (DynamicRecord arrayRecord : arrayRecords) {
         arrayRecord.setType(PropertyType.ARRAY.intValue());
         block.addValueRecord(arrayRecord);
       }
     }
     for (DynamicRecord arrayRecord : block.getValueRecords()) {
       arrayPropertyStore.ensureHeavy(arrayRecord);
     }
   }
 }
Exemplo n.º 2
0
 @Override
 public void logAllWindowPoolStats(StringLogger.LineLogger logger) {
   super.logAllWindowPoolStats(logger);
   propertyKeyTokenStore.logAllWindowPoolStats(logger);
   logger.logLine(stringPropertyStore.getWindowPoolStats().toString());
   logger.logLine(arrayPropertyStore.getWindowPoolStats().toString());
 }
Exemplo n.º 3
0
 @Override
 public void makeStoreOk() {
   propertyKeyTokenStore.makeStoreOk();
   stringPropertyStore.makeStoreOk();
   arrayPropertyStore.makeStoreOk();
   super.makeStoreOk();
 }
Exemplo n.º 4
0
 @Override
 public void logVersions(StringLogger.LineLogger logger) {
   super.logVersions(logger);
   propertyKeyTokenStore.logVersions(logger);
   stringPropertyStore.logVersions(logger);
   arrayPropertyStore.logVersions(logger);
 }
Exemplo n.º 5
0
 @Override
 protected void unsetRecovered() {
   super.unsetRecovered();
   stringPropertyStore.unsetRecovered();
   propertyIndexStore.unsetRecovered();
   arrayPropertyStore.unsetRecovered();
 }
Exemplo n.º 6
0
 @Override
 protected void setRecovered() {
   super.setRecovered();
   stringPropertyStore.setRecovered();
   propertyKeyTokenStore.setRecovered();
   arrayPropertyStore.setRecovered();
 }
Exemplo n.º 7
0
 public PropertyRecord getRecord(long id) {
   PropertyRecord record;
   PersistenceWindow window = acquireWindow(id, OperationType.READ);
   try {
     record = getRecord(id, window, RecordLoad.NORMAL);
   } finally {
     releaseWindow(window);
   }
   for (PropertyBlock block : record.getPropertyBlocks()) {
     // assert block.inUse();
     if (block.getType() == PropertyType.STRING) {
       Collection<DynamicRecord> stringRecords =
           stringPropertyStore.getLightRecords(block.getSingleValueLong());
       for (DynamicRecord stringRecord : stringRecords) {
         stringRecord.setType(PropertyType.STRING.intValue());
         block.addValueRecord(stringRecord);
       }
     } else if (block.getType() == PropertyType.ARRAY) {
       Collection<DynamicRecord> arrayRecords =
           arrayPropertyStore.getLightRecords(block.getSingleValueLong());
       for (DynamicRecord arrayRecord : arrayRecords) {
         arrayRecord.setType(PropertyType.ARRAY.intValue());
         block.addValueRecord(arrayRecord);
       }
     }
   }
   return record;
 }
Exemplo n.º 8
0
 @Override
 public void flushAll() {
   stringPropertyStore.flushAll();
   propertyIndexStore.flushAll();
   arrayPropertyStore.flushAll();
   super.flushAll();
 }
Exemplo n.º 9
0
 @Override
 protected void closeStorage() {
   if (nameStore != null) {
     nameStore.close();
     nameStore = null;
   }
 }
Exemplo n.º 10
0
 @Override
 public void makeStoreOk() {
   propertyIndexStore.makeStoreOk();
   stringPropertyStore.makeStoreOk();
   arrayPropertyStore.makeStoreOk();
   super.makeStoreOk();
 }
Exemplo n.º 11
0
 @Override
 public void logIdUsage(StringLogger.LineLogger logger) {
   super.logIdUsage(logger);
   propertyIndexStore.logIdUsage(logger);
   stringPropertyStore.logIdUsage(logger);
   arrayPropertyStore.logIdUsage(logger);
 }
Exemplo n.º 12
0
 @Override
 public void rebuildIdGenerators() {
   propertyIndexStore.rebuildIdGenerators();
   stringPropertyStore.rebuildIdGenerators();
   arrayPropertyStore.rebuildIdGenerators();
   super.rebuildIdGenerators();
 }
Exemplo n.º 13
0
 @Override
 public List<WindowPoolStats> getAllWindowPoolStats() {
   List<WindowPoolStats> list = new ArrayList<WindowPoolStats>();
   list.add(nameStore.getWindowPoolStats());
   list.add(getWindowPoolStats());
   return list;
 }
Exemplo n.º 14
0
 public void makeHeavy(T record) {
   record.setIsLight(false);
   Collection<DynamicRecord> keyRecords = nameStore.getRecords(record.getNameId());
   for (DynamicRecord keyRecord : keyRecords) {
     record.addNameRecord(keyRecord);
   }
 }
Exemplo n.º 15
0
 @Override
 public List<WindowPoolStats> getAllWindowPoolStats() {
   List<WindowPoolStats> list = new ArrayList<WindowPoolStats>();
   list.add(stringPropertyStore.getWindowPoolStats());
   list.add(arrayPropertyStore.getWindowPoolStats());
   list.add(getWindowPoolStats());
   return list;
 }
Exemplo n.º 16
0
 private void updateDynamicRecords(List<DynamicRecord> records) {
   for (DynamicRecord valueRecord : records) {
     if (valueRecord.getType() == PropertyType.STRING.intValue()) {
       stringPropertyStore.updateRecord(valueRecord);
     } else if (valueRecord.getType() == PropertyType.ARRAY.intValue()) {
       arrayPropertyStore.updateRecord(valueRecord);
     } else {
       throw new InvalidRecordException("Unknown dynamic record" + valueRecord);
     }
   }
 }
Exemplo n.º 17
0
 public void updateRecord(T record) {
   PersistenceWindow window = acquireWindow(record.getId(), OperationType.WRITE);
   try {
     updateRecord(record, window);
   } finally {
     releaseWindow(window);
   }
   if (!record.isLight()) {
     for (DynamicRecord keyRecord : record.getNameRecords()) {
       nameStore.updateRecord(keyRecord);
     }
   }
 }
Exemplo n.º 18
0
 public T getRecord(int id) {
   T record;
   PersistenceWindow window = acquireWindow(id, OperationType.READ);
   try {
     record = getRecord(id, window, false);
   } finally {
     releaseWindow(window);
   }
   Collection<DynamicRecord> keyRecords = nameStore.getLightRecords(record.getNameId());
   for (DynamicRecord keyRecord : keyRecords) {
     record.addNameRecord(keyRecord);
   }
   return record;
 }
Exemplo n.º 19
0
 @Override
 protected void closeStorage() {
   if (stringPropertyStore != null) {
     stringPropertyStore.close();
     stringPropertyStore = null;
   }
   if (propertyIndexStore != null) {
     propertyIndexStore.close();
     propertyIndexStore = null;
   }
   if (arrayPropertyStore != null) {
     arrayPropertyStore.close();
     arrayPropertyStore = null;
   }
 }
Exemplo n.º 20
0
 /*
  * This will add the value records without checking if they are already
  * in the block - so make sure to call this after checking isHeavy() or
  * you will end up with duplicates.
  */
 public void makeHeavy(PropertyBlock record) {
   if (record.getType() == PropertyType.STRING) {
     Collection<DynamicRecord> stringRecords =
         stringPropertyStore.getLightRecords(record.getSingleValueLong());
     for (DynamicRecord stringRecord : stringRecords) {
       stringRecord.setType(PropertyType.STRING.intValue());
       record.addValueRecord(stringRecord);
     }
   } else if (record.getType() == PropertyType.ARRAY) {
     Collection<DynamicRecord> arrayRecords =
         arrayPropertyStore.getLightRecords(record.getSingleValueLong());
     for (DynamicRecord arrayRecord : arrayRecords) {
       arrayRecord.setType(PropertyType.ARRAY.intValue());
       record.addValueRecord(arrayRecord);
     }
   }
 }
Exemplo n.º 21
0
 public void makeHeavyIfLight(PropertyBlock record) {
   if (record.isLight()) {
     /*
      * This will add the value records without checking if they are already
      * in the block - so we only call this after checking isLight() or
      * else we will end up with duplicates.
      */
     if (record.getType() == PropertyType.STRING) {
       Collection<DynamicRecord> stringRecords =
           stringPropertyStore.getLightRecords(record.getSingleValueLong());
       for (DynamicRecord stringRecord : stringRecords) {
         stringRecord.setType(PropertyType.STRING.intValue());
         record.addValueRecord(stringRecord);
       }
     } else if (record.getType() == PropertyType.ARRAY) {
       Collection<DynamicRecord> arrayRecords =
           arrayPropertyStore.getLightRecords(record.getSingleValueLong());
       for (DynamicRecord arrayRecord : arrayRecords) {
         arrayRecord.setType(PropertyType.ARRAY.intValue());
         record.addValueRecord(arrayRecord);
       }
     }
   }
 }
Exemplo n.º 22
0
 public void freeStringBlockId(long blockId) {
   stringPropertyStore.freeBlockId(blockId);
 }
Exemplo n.º 23
0
 @Override
 public void rebuildIdGenerators() {
   nameStore.rebuildIdGenerators();
   super.rebuildIdGenerators();
 }
Exemplo n.º 24
0
 public int getStringBlockSize() {
   return stringPropertyStore.getBlockSize();
 }
Exemplo n.º 25
0
 public void updateIdGenerators() {
   nameStore.updateHighId();
   this.updateHighId();
 }
Exemplo n.º 26
0
 private Collection<DynamicRecord> allocateStringRecords(long valueBlockId, byte[] chars) {
   return stringPropertyStore.allocateRecords(valueBlockId, chars);
 }
Exemplo n.º 27
0
 public void updateIdGenerators() {
   propertyIndexStore.updateIdGenerators();
   stringPropertyStore.updateHighId();
   arrayPropertyStore.updateHighId();
   this.updateHighId();
 }
Exemplo n.º 28
0
 public void freeBlockId(int id) {
   nameStore.freeBlockId(id);
 }
Exemplo n.º 29
0
 @Override
 public void flushAll() {
   nameStore.flushAll();
   super.flushAll();
 }
Exemplo n.º 30
0
 private long nextStringBlockId() {
   return stringPropertyStore.nextBlockId();
 }