add flush to gateway
This commit is contained in:
parent
485f904140
commit
1c2733ebee
|
@ -87,6 +87,11 @@ public interface Translog extends IndexShardComponent {
|
|||
*/
|
||||
Snapshot snapshot(Snapshot snapshot);
|
||||
|
||||
/**
|
||||
* Flushes the translog.
|
||||
*/
|
||||
void flush();
|
||||
|
||||
/**
|
||||
* Closes the transaction log.
|
||||
*/
|
||||
|
|
|
@ -185,6 +185,18 @@ public class FsTranslog extends AbstractIndexShardComponent implements Translog
|
|||
}
|
||||
}
|
||||
|
||||
@Override public void flush() {
|
||||
synchronized (mutex) {
|
||||
if (raf != null) {
|
||||
try {
|
||||
raf.raf().getFD().sync();
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public void close(boolean delete) {
|
||||
synchronized (mutex) {
|
||||
if (raf != null) {
|
||||
|
|
Loading…
Reference in New Issue