core/src/main/java/org/elasticsearch/index/translog/Translog.java
public boolean ensureSynced(Location location) throws IOException {
        try (ReleasableLock lock = readLock.acquire()) {
            if (location.generation == current.getGeneration()) { // if we have a new one it's already synced
                ensureOpen();
                return current.syncUpTo(location.translogLocation + location.size);
            }
        } catch (Throwable ex) {
            closeOnTragicEvent(ex);
            throw ex;
        }
        return false;
    }
/**
     * Ensures that the given location has be synced / written to the underlying storage.
     *
     * @return Returns <code>true</code> iff this call caused an actual sync operation otherwise <code>false</code>
     */
Ensures that the given location has be synced / written to the underlying storage.
@return Returns true iff this call caused an actual sync operation otherwise false
Ensures that the given location has be synced / written to the underlying storage . @return Returns true iff this call caused an actual sync operation otherwise false
public boolean ensureSynced(Location location) throws IOException {
        try (ReleasableLock lock = readLock.acquire()) {
            if (location.generation == current.getGeneration()) { 
                ensureOpen();
                return current.syncUpTo(location.translogLocation + location.size);
            }
        } catch (Throwable ex) {
            closeOnTragicEvent(ex);
            throw ex;
        }
        return false;
    }
public boolean ensureSynced ( Location location ) throws IOException { try ( ReleasableLock lock = readLock . acquire ( ) ) { if ( location . generation == current . getGeneration ( ) ) { ensureOpen ( ) ; return current . syncUpTo ( location . translogLocation + location . size ) ; } } catch ( Throwable ex ) { closeOnTragicEvent ( ex ) ; throw ex ; } return false ; }
Ensures that the given location has be synced / written to the underlying storage.
Ensures that the given location has be synced / written to the underlying storage .
// if we have a new one it's already synced