synchronized DataFileAccessor openDataFileAccessor(DataFile dataFile) throws IOException { if (closed) { throw new IOException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool == null) { pool = new Pool(dataFile); pools.put(dataFile.getDataFileId(), pool); } return pool.openDataFileReader(); }
synchronized void closeDataFileAccessor(DataFileAccessor reader) { Pool pool = pools.get(reader.getDataFile().getDataFileId()); if (pool == null || closed) { reader.dispose(); } else { pool.closeDataFileReader(reader); } }
synchronized void disposeDataFileAccessors(DataFile dataFile) { if (closed) { throw new IllegalStateException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool != null) { if (pool.getOpenCounter() == 0) { pool.dispose(); pools.remove(dataFile.getDataFileId()); } else { throw new IllegalStateException("The data file is still in use: " + dataFile + ", use count: " + pool.getOpenCounter()); } } }
synchronized void disposeDataFileAccessors(DataFile dataFile) { if (closed) { throw new IllegalStateException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool != null) { if (pool.getOpenCounter() == 0) { pool.dispose(); pools.remove(dataFile.getDataFileId()); } else { throw new IllegalStateException("The data file is still in use: " + dataFile + ", use count: " + pool.getOpenCounter()); } } }
synchronized void disposeDataFileAccessors(DataFile dataFile) { if (closed) { throw new IllegalStateException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool != null) { if (pool.getOpenCounter() == 0) { pool.dispose(); pools.remove(dataFile.getDataFileId()); } else { throw new IllegalStateException("The data file is still in use: " + dataFile + ", use count: " + pool.getOpenCounter()); } } }
public synchronized void close() { if (closed) { return; } closed = true; for (Pool pool : pools.values()) { pool.dispose(); } pools.clear(); }
synchronized void closeDataFileAccessor(DataFileAccessor reader) { Pool pool = pools.get(reader.getDataFile().getDataFileId()); if (pool == null || closed) { reader.dispose(); } else { pool.closeDataFileReader(reader); } }
public synchronized void close() { if (closed) { return; } closed = true; for (Pool pool : pools.values()) { pool.dispose(); } pools.clear(); }
synchronized void closeDataFileAccessor(DataFileAccessor reader) { Pool pool = pools.get(reader.getDataFile().getDataFileId()); if (pool == null || closed) { reader.dispose(); } else { pool.closeDataFileReader(reader); } }
synchronized void disposeDataFileAccessors(DataFile dataFile) { if (closed) { throw new IllegalStateException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool != null) { if (pool.getOpenCounter() == 0) { pool.dispose(); pools.remove(dataFile.getDataFileId()); } else { throw new IllegalStateException("The data file is still in use: " + dataFile + ", use count: " + pool.getOpenCounter()); } } }
synchronized DataFileAccessor openDataFileAccessor(DataFile dataFile) throws IOException { if (closed) { throw new IOException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool == null) { pool = new Pool(dataFile); pools.put(dataFile.getDataFileId(), pool); } return pool.openDataFileReader(); }
synchronized void closeDataFileAccessor(DataFileAccessor reader) { Pool pool = pools.get(reader.getDataFile().getDataFileId()); if (pool == null || closed) { reader.dispose(); } else { pool.closeDataFileReader(reader); } }
synchronized DataFileAccessor openDataFileAccessor(DataFile dataFile) throws IOException { if (closed) { throw new IOException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool == null) { pool = new Pool(dataFile); pools.put(dataFile.getDataFileId(), pool); } return pool.openDataFileReader(); }
public synchronized void close() { if (closed) { return; } closed = true; for (Pool pool : pools.values()) { pool.dispose(); } pools.clear(); }
synchronized DataFileAccessor openDataFileAccessor(DataFile dataFile) throws IOException { if (closed) { throw new IOException("Closed."); } Pool pool = pools.get(dataFile.getDataFileId()); if (pool == null) { pool = new Pool(dataFile); pools.put(dataFile.getDataFileId(), pool); } return pool.openDataFileReader(); }
public synchronized void close() { if (closed) { return; } closed = true; for (Pool pool : pools.values()) { pool.dispose(); } pools.clear(); }