Examples of force()


Examples of java.nio.channels.FileChannel.force()

               for (Map.Entry<String, FileChannel> entry : streams.entrySet()) {
                  if (trace)
                     log.tracef("Flushing channel in %s", entry.getKey());
                  FileChannel channel = entry.getValue();
                  try {
                     channel.force(true);
                  } catch (IOException e) {
                     if (trace)
                        log.tracef(e, "Error flushing output stream for %s", entry.getKey());
                     flushErrors.putIfAbsent(entry.getKey(), e);
                     // If an error is encountered, close it. Next time it's used,
View Full Code Here

Examples of java.nio.channels.FileChannel.force()

                if (file != null) {
                    bumpWriteCount("fsync");
                    FileChannel ch = file.getChannel();
                    try {
                        long start  = System.currentTimeMillis();
                        ch.force(false);
                        nLogFSyncs.increment();
                        final long fsyncMs = System.currentTimeMillis() - start;
                        nFSyncTime.add(fsyncMs);
                    } catch (ClosedChannelException e) {
View Full Code Here

Examples of java.nio.channels.FileChannel.force()

        long bytesWritten = output.transferFrom(input, position, bytesLeft);
        bytesLeft -= bytesWritten;
        position += bytesWritten;
      }
      if (datanode.syncOnClose) {
        output.force(true);
      }
    } finally {
      if (input != null) {
        input.close();
      }
View Full Code Here

Examples of java.nio.channels.FileChannel.force()

            bb.flip();
            ch.write( bb );
        }

        // Flush to the disk for real
        ch.force( true );
        ch.close();

        // Rename the current file to save a backup
        File backupFile = File.createTempFile( "mavibot", null, baseDirectory );
        file.renameTo( backupFile );
View Full Code Here

Examples of java.nio.channels.FileChannel.force()

                    FileChannel fileChannel = new FileOutputStream(new File(destinationDirPath,
                                                                            fileEntry.getFileName())).getChannel();
                    ReadableByteChannel channelIn = Channels.newChannel(inputStream);
                    fileChannel.transferFrom(channelIn, 0, fileEntry.getFileSizeBytes());
                    fileChannel.force(true);
                    fileChannel.close();

                    logger.info("Completed file " + fileEntry.getFileName());
                }
View Full Code Here

Examples of java.nio.channels.FileChannel.force()

      int bytesWritten = _eventBuffer.batchWrite(readRangeLock.getRange(), writeChannel, _encoding);
      _totalBytesWritten += bytesWritten;
      _currentFileBytesWritten += bytesWritten;
      if ((System.currentTimeMillis() - _lastFsyncTime) > _fsyncIntervalInMillis)
      {
        writeChannel.force(true);
      }
    }
  }

View Full Code Here

Examples of java.nio.channels.FileChannel.force()

                }

                tableBuilder.finish();
            } finally {
                try {
                    channel.force(true);
                } finally {
                    channel.close();
                }
            }
View Full Code Here

Examples of org.apache.activemq.kaha.impl.data.DataManager.force()

                IndexManager im=(IndexManager)iter.next();
                im.force();
            }
            for(Iterator iter=dataManagers.values().iterator();iter.hasNext();){
                DataManager dm=(DataManager)iter.next();
                dm.force();
            }
        }
    }

    public synchronized void clear() throws IOException{
View Full Code Here

Examples of org.apache.activemq.kaha.impl.index.IndexManager.force()

    public synchronized void force() throws IOException {
        if (initialized) {
            for (Iterator<IndexManager> iter = indexManagers.values().iterator(); iter.hasNext();) {
                IndexManager im = iter.next();
                im.force();
            }
            for (Iterator<DataManager> iter = dataManagers.values().iterator(); iter.hasNext();) {
                DataManager dm = iter.next();
                dm.force();
            }
View Full Code Here

Examples of org.elasticsearch.action.admin.indices.flush.FlushRequest.force()

        c.admin().indices().updateSettings(new UpdateSettingsRequest(index).settings(sb.build())).actionGet();
    }

    public void flush(String index) {
        FlushRequest flush = new FlushRequest(index);
        flush.force(true); // Just flushes. Even if it is not necessary.
        flush.full(false);

        c.admin().indices().flush(new FlushRequest(index).force(true)).actionGet();
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.