private void init() { this.gtfsFeedIds = data.getHashSet("gtfsFeeds"); this.operatingDayPatterns = data.getHashMap("validities"); this.timeZones = data.getHashMap("timeZones"); Map<Integer, FeedIdWithTimezone> readableTimeZones = new HashMap<>(); for (Map.Entry<FeedIdWithTimezone, Integer> entry : this.timeZones.entrySet()) { readableTimeZones.put(entry.getValue(), entry.getKey()); } Bind.mapInverse(this.timeZones, readableTimeZones); this.readableTimeZones = Collections.unmodifiableMap(readableTimeZones); this.tripDescriptors = data.getTreeMap("tripDescriptors"); this.stopSequences = data.getTreeMap("stopSequences"); this.fares = data.getTreeMap("fares"); this.boardEdgesForTrip = data.getHashMap("boardEdgesForTrip"); this.leaveEdgesForTrip = data.getHashMap("leaveEdgesForTrip"); this.stationNodes = data.getHashMap("stationNodes"); this.routes = data.getHashMap("routes"); }
@Inject public RelationshipMap(DB maker) { delegate = maker.getHashMap(RelationshipMap.class.getName()); }
@Inject public IdMap(DB maker) { delegate = maker.getHashMap(IdMap.class.getName()); }
private void init() { DBMaker maker; if (file == null) maker = DBMaker.newMemoryDB(); else { if (overwrite) wipe(file); maker = DBMaker.newFileDB(new File(file)); maker = maker.cacheSize(cache_size); if (async) { maker = maker.asyncWriteEnable(); maker = maker.asyncWriteFlushDelay(10000); } if (mmap) maker = maker.mmapFileEnableIfSupported(); if (compression) maker = maker.compressionEnable(); if (snapshot) maker = maker.snapshotEnable(); if (notxn) maker = maker.transactionDisable(); } db = maker.make(); if (!db.exists("idmap")) idmap = db.createHashMap("idmap") .valueSerializer(new RecordSerializer()) .make(); else idmap = db.getHashMap("idmap"); }
public OperatorSumCellValues(boolean useDisk) { if (useDisk) map = MapDb.INSTANCE.getDb().getHashMap(UUID.randomUUID().toString()); else map = new HashMap<Position, Double>(INITIAL_CAPACITY, 1.0f); }
File file = new File(“dbFileName”); DB db = DBMaker.newFileDB(file).make(); //use map Map map = db.getHashMap(“mapName”); map.put(“aa”,”bb”); //commit and close database db.commit(); db.close();
public MessageQueueSleepImpl(String name) { _nameMap = IMap.MAP_PREFIX + "_msg_sleep_" + name; _map = OffHeapFactory.store().getHashMap(_nameMap); if (AppProperties.getInstance().getClearMessagesQueueOnStart()) { _map.clear(); } else { _logger.debug("Continuing with offline messages in the map:[{}]", _nameMap); } }
/** * Initialise a new cache with an identifier name and the maximum amount of objects allowed. * * @param name - Cache Identifier * @param maxItems - Number of object allowed */ protected Cache(String name, int maxItems){ this.name = name; File tempFolder = new File("/tmp/caches/"); if (!tempFolder.exists()) tempFolder.mkdirs(); File tempFile = new File("/tmp/caches/luzzu_"+name); if (!tempFile.exists()){ try { tempFile.createNewFile(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } this.db = DBMaker.newFileDB(tempFile) .cacheLRUEnable() .cacheSize(Integer.parseInt(PropertyManager.getInstance().getProperties("cache.properties").getProperty("CACHE_SIZE_IN_GB"))) .cacheSize(maxItems).make(); this.cache = db.getHashMap("cache_"+name); }
public MessageQueueSleepImpl(String name) { _nameMap = IMap.MAP_PREFIX + "_msg_sleep_" + name; _map = OffHeapFactory.store().getHashMap(_nameMap); if (AppProperties.getInstance().getClearMessagesQueueOnStart()) { _map.clear(); } else { _logger.debug("Continuing with offline messages in the map:[{}]", _nameMap); } }
public static HTreeMap<String, FirmwareData> getFirmwareMap() { if (FIRMWARE_OFFLINE_MAP == null) { OffHeapFactory.store().delete(FIRMWARE_MAP);//Remove existing map FIRMWARE_OFFLINE_MAP = OffHeapFactory.store().getHashMap(FIRMWARE_MAP); FIRMWARE_OFFLINE_MAP.clear(); } return FIRMWARE_OFFLINE_MAP; }
public static HTreeMap<String, FirmwareData> getFirmwareMap() { if (FIRMWARE_OFFLINE_MAP == null) { OffHeapFactory.store().delete(FIRMWARE_MAP);//Remove existing map FIRMWARE_OFFLINE_MAP = OffHeapFactory.store().getHashMap(FIRMWARE_MAP); FIRMWARE_OFFLINE_MAP.clear(); } return FIRMWARE_OFFLINE_MAP; }
items = db.getHashMap("items");
public KnownPhraseSim(String name, Language language, PhraseCreator creator, File dir, StringNormalizer stringNormalizer) throws IOException { this.name = name; this.language = language; this.creator = creator; this.stringNormalizer = stringNormalizer; this.dir = dir; this.dir.mkdirs(); this.phraseDb = DBMaker .newFileDB(new File(dir, "phrases.mapdb")) .mmapFileEnable() .transactionDisable() .asyncWriteEnable() .asyncWriteFlushDelay(100) .make(); this.db = phraseDb.getHashMap("phrases"); this.readPhrases(); this.readCosimilarity(); File f = new File(dir, "scoreNormalizer.bin"); if (f.isFile()) { scoreNormalizer = (Normalizer) WpIOUtils.readObjectFromFile(f); } }
this.data = this.cache.getHashMap(credentials == null ? "data" : "data-" + credentials.getId()); cache.commit(); success = true;
.make(); else idmap = db.getHashMap("idmap");
if (db.exists(name)) { logger.debug("Reopening storage for '{0}' index in workspace '{1}'", name, workspaceName); this.options = db.getHashMap(name + "/options"); this.keysByValue = db.getTreeMap(name); this.valuesByKey = db.getTreeSet(name + "/inverse");
if (db.exists(name)) { logger.debug("Reopening storage for '{0}' index in workspace '{1}'", name, workspaceName); this.options = db.getHashMap(name + "/options"); this.keysByValue = db.getTreeMap(name); this.valuesByKey = db.getTreeSet(name + "/inverse");