synchronized public long transferTo(final RandomAccessFile out) throws IOException { if (out == null) throw new IllegalArgumentException(); /* * Note: Force the write cache to the disk so that all the data we want * to transfer from channel to channel are actually on the source * channel! * * Note: This also handles the case for a Temporary store where the * backing file has not even been created yet. */ flushWriteCache(); return super.transferFromDiskTo(this, out); }
synchronized public long transferTo(final RandomAccessFile out) throws IOException { if (out == null) throw new IllegalArgumentException(); /* * Note: Force the write cache to the disk so that all the data we want * to transfer from channel to channel are actually on the source * channel! * * Note: This also handles the case for a Temporary store where the * backing file has not even been created yet. */ flushWriteCache(); return super.transferFromDiskTo(this, out); }
/** * Need to override commit to ensure the writeCache is flushed prior to * writing the root block. * * For the DiskOnlyStrategy flushing the writeCache also ensures the backing * file is created if the file is temporary. * * Note that the internal call to flush the writeCache must be synchronized * or concurrent writers to the cache will cause problems. */ @Override public void commit() { if (writeCache != null) { synchronized (this) { flushWriteCache(); } } super.commit(); }
/** * Need to override commit to ensure the writeCache is flushed prior to * writing the root block. * * For the DiskOnlyStrategy flushing the writeCache also ensures the backing * file is created if the file is temporary. * * Note that the internal call to flush the writeCache must be synchronized * or concurrent writers to the cache will cause problems. */ @Override public void commit() { if (writeCache != null) { synchronized (this) { flushWriteCache(); } } super.commit(); }
/** * {@link #flushWriteCache() flushes} the {@link #writeCache} before syncing * the disk. */ public void force(final boolean metadata) { assertOpen(); synchronized(this) { // flush all pending writes to disk. flushWriteCache(); } try { if(!temporaryStore) { // sync the disk. getChannel().force(metadata); } } catch (IOException ex) { throw new RuntimeException(ex); } storeCounters.nforce++; }
/** * {@link #flushWriteCache() flushes} the {@link #writeCache} before syncing * the disk. */ public void force(final boolean metadata) { assertOpen(); synchronized(this) { // flush all pending writes to disk. flushWriteCache(); } try { if(!temporaryStore) { // sync the disk. getChannel().force(metadata); } } catch (IOException ex) { throw new RuntimeException(ex); } storeCounters.nforce++; }