private void addCacheDirective(final String poolName, final CacheDirective directive) throws IOException { CachePool pool = cachePools.get(poolName); if (pool == null) { throw new IOException("Directive refers to pool " + poolName + ", which does not exist."); } boolean addedDirective = pool.getDirectiveList().add(directive); assert addedDirective; if (directivesById.put(directive.getId(), directive) != null) { throw new IOException("A directive with ID " + directive.getId() + " already exists"); } List<CacheDirective> directives = directivesByPath.get(directive.getPath()); if (directives == null) { directives = new LinkedList<CacheDirective>(); directivesByPath.put(directive.getPath(), directives); } directives.add(directive); }
private void addInternal(CacheDirective directive, CachePool pool) { boolean addedDirective = pool.getDirectiveList().add(directive); assert addedDirective; directivesById.put(directive.getId(), directive); String path = directive.getPath(); List<CacheDirective> directives = directivesByPath.get(path); if (directives == null) { directives = new ArrayList<CacheDirective>(1); directivesByPath.put(path, directives); } directives.add(directive); // Fix up pool stats CacheDirectiveStats stats = computeNeeded(directive.getPath(), directive.getReplication()); directive.addBytesNeeded(stats.getBytesNeeded()); directive.addFilesNeeded(directive.getFilesNeeded()); setNeedsRescan(); }
private void addCacheDirective(final String poolName, final CacheDirective directive) throws IOException { CachePool pool = cachePools.get(poolName); if (pool == null) { throw new IOException("Directive refers to pool " + poolName + ", which does not exist."); } boolean addedDirective = pool.getDirectiveList().add(directive); assert addedDirective; if (directivesById.put(directive.getId(), directive) != null) { throw new IOException("A directive with ID " + directive.getId() + " already exists"); } List<CacheDirective> directives = directivesByPath.get(directive.getPath()); if (directives == null) { directives = new LinkedList<CacheDirective>(); directivesByPath.put(directive.getPath(), directives); } directives.add(directive); }
private void addCacheDirective(final String poolName, final CacheDirective directive) throws IOException { CachePool pool = cachePools.get(poolName); if (pool == null) { throw new IOException("Directive refers to pool " + poolName + ", which does not exist."); } boolean addedDirective = pool.getDirectiveList().add(directive); assert addedDirective; if (directivesById.put(directive.getId(), directive) != null) { throw new IOException("A directive with ID " + directive.getId() + " already exists"); } List<CacheDirective> directives = directivesByPath.get(directive.getPath()); if (directives == null) { directives = new LinkedList<CacheDirective>(); directivesByPath.put(directive.getPath(), directives); } directives.add(directive); }
private void addInternal(CacheDirective directive, CachePool pool) { boolean addedDirective = pool.getDirectiveList().add(directive); assert addedDirective; directivesById.put(directive.getId(), directive); String path = directive.getPath(); List<CacheDirective> directives = directivesByPath.get(path); if (directives == null) { directives = new ArrayList<CacheDirective>(1); directivesByPath.put(path, directives); } directives.add(directive); // Fix up pool stats CacheDirectiveStats stats = computeNeeded(directive.getPath(), directive.getReplication()); directive.addBytesNeeded(stats.getBytesNeeded()); directive.addFilesNeeded(directive.getFilesNeeded()); setNeedsRescan(); }
private void addInternal(CacheDirective directive, CachePool pool) { boolean addedDirective = pool.getDirectiveList().add(directive); assert addedDirective; directivesById.put(directive.getId(), directive); String path = directive.getPath(); List<CacheDirective> directives = directivesByPath.get(path); if (directives == null) { directives = new ArrayList<CacheDirective>(1); directivesByPath.put(path, directives); } directives.add(directive); // Fix up pool stats CacheDirectiveStats stats = computeNeeded(directive.getPath(), directive.getReplication()); directive.addBytesNeeded(stats.getBytesNeeded()); directive.addFilesNeeded(directive.getFilesNeeded()); setNeedsRescan(); }