mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-17 10:25:15 +00:00
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…
x
Reference in New Issue
Block a user