Synchronizes mount points. Removes things before
        adding new.
18323
def sync_mounts(self, active_mounts, resources, vault_client):
        """"""
        # Create a resource set that is only explicit mounts
        # and sort so removals are first
        mounts = [x for x in resources
                  if isinstance(x, (Mount, AWS))]

        s_resources = sorted(mounts, key=absent_sort)
        # Iterate over explicit mounts only
        for resource in s_resources:
            active_mounts = self.actually_mount(vault_client,
                                                resource,
                                                active_mounts)

        # OK Now iterate over everything but make sure it is clear
        # that ad-hoc mountpoints are deprecated as per
        # https://github.com/Autodesk/aomi/issues/110
        for resource in [x for x in resources
                         if isinstance(x, Secret)]:
            n_mounts = self.actually_mount(vault_client,
                                           resource,
                                           active_mounts)
            if len(n_mounts) != len(active_mounts):
                LOG.warning("Ad-Hoc mount with %s. Please specify"
                            " explicit mountpoints.", resource)

            active_mounts = n_mounts

        return active_mounts, [x for x in resources
                               if not isinstance(x, (Mount))]
1061881
function symlinkOrCopySync(dir, target) {
  try {
    symlinkOrCopy.sync(dir, target);
  } catch (e) {
    if (existsSync(target)) {
      rimraf.sync(target);
    }
    symlinkOrCopy.sync(dir, target);
  }
}
567332
def purge(self, ignore_ignores):
        """"""
        command = ['sync', '#none']
        if ignore_ignores:
            command.append('--no-ignore')
        d = self._dovccmd(command, collectStdout=True)

        # add deferred to rm tree

        # then add defer to sync to revision
        return d
519533
public synchronized void synchronizeWith(UpdateSynchronizer newsync) {
    // LoggingUtil.warning("Synchronizing: " + sync + " " + newsync, new
    // Throwable());
    if(synchronizer == newsync) {
      LoggingUtil.warning("Double-synced to the same plot!", new Throwable());
      return;
    }
    if(synchronizer != null) {
      LoggingUtil.warning("Attempting to synchronize to more than one synchronizer.");
      return;
    }
    synchronizer = newsync;
    newsync.addUpdateRunner(this);
  }
1367785
def device_add(self, mountpoint, *device):
        
        if len(device) == 0:
            return

        args = {
            'mountpoint': mountpoint,
            'devices': device,
        }

        self._device_chk.check(args)

        self._client.sync('btrfs.device_add', args)
688774
def flush(self):
        
        annotation = self.get_annotation()
        if annotation.get(ATTACHMENTS_STORAGE) is not None:
            del annotation[ATTACHMENTS_STORAGE]
307624
public static void cleanup(MountOwner owner) {
        final Set<RegistryEntry> references = ownerReferences.remove(owner);
        if (references != null) {
            for (RegistryEntry entry : references) {
                entry.removeInboundReference(owner);
            }
        }
        owner.onCleanup();
    }
164434
synchronized void sync()
    {
        try
        {
            // check we have more work to do
            if (allocatePosition.get() <= lastSyncedOffset + SYNC_MARKER_SIZE)
                return;

            // allocate a new sync marker; this is both necessary in itself, but also serves to demarcate
            // the point at which we can safely consider records to have been completely written to
            int nextMarker;
            nextMarker = allocate(SYNC_MARKER_SIZE);
            boolean close = false;
            if (nextMarker < 0)
            {
                // ensure no more of this CLS is writeable, and mark ourselves for closing
                discardUnusedTail();
                close = true;

                // wait for modifications guards both discardedTailFrom, and any outstanding appends
                waitForModifications();

                if (discardedTailFrom < buffer.capacity() - SYNC_MARKER_SIZE)
                {
                    // if there's room in the discard section to write an empty header, use that as the nextMarker
                    nextMarker = discardedTailFrom;
                }
                else
                {
                    // not enough space left in the buffer, so mark the next sync marker as the EOF position
                    nextMarker = buffer.capacity();
                }
            }
            else
            {
                waitForModifications();
            }

            assert nextMarker > lastSyncedOffset;

            // write previous sync marker to point to next sync marker
            // we don't chain the crcs here to ensure this method is idempotent if it fails
            int offset = lastSyncedOffset;
            final PureJavaCrc32 crc = new PureJavaCrc32();
            crc.updateInt((int) (id & 0xFFFFFFFFL));
            crc.updateInt((int) (id >>> 32));
            crc.updateInt(offset);
            buffer.putInt(offset, nextMarker);
            buffer.putInt(offset + 4, crc.getCrc());

            // zero out the next sync marker so replayer can cleanly exit
            if (nextMarker < buffer.capacity())
            {
                buffer.putInt(nextMarker, 0);
                buffer.putInt(nextMarker + 4, 0);
            }

            // actually perform the sync and signal those waiting for it
            buffer.force();

            if (close)
                nextMarker = buffer.capacity();

            lastSyncedOffset = nextMarker;
            syncComplete.signalAll();

            CLibrary.trySkipCache(fd, offset, nextMarker);
            if (close)
                internalClose();
        }
        catch (Exception e) // MappedByteBuffer.force() does not declare IOException but can actually throw it
        {
            throw new FSWriteError(e, getPath());
        }
    }
1203439
@Override
    public void synchronizeThreadDevice(Long threadId, Integer deviceId, AllocationPoint point) {
        // we synchronize only if this AllocationPoint was used within device context, so for multiple consequent syncs only first one will be issued
        flowController.synchronizeToHost(point);
    }
95498
def bindmount(self, mountpoint):
        

        if not self.mountpoint:
            raise NotMountedError(self)
        try:
            _util.check_call_(['mount', '--bind', self.mountpoint, mountpoint], stdout=subprocess.PIPE)
            if 'bindmounts' in self._paths:
                self._paths['bindmounts'].append(mountpoint)
            else:
                self._paths['bindmounts'] = [mountpoint]
            return True
        except Exception as e:
            logger.exception("Error bind mounting {0}.".format(self))
            raise SubsystemError(e)
1274855
protected void syncCompactor() {
        ConcurrentLinkedQueue<Segment> queue = _compactor.getCompactedQueue();
        while(!queue.isEmpty()) {
            Segment seg = queue.remove();
            consumeCompactionBatches();
            _compactor.getFreeQueue().offer(seg);
        }
        
        consumeCompactionBatches();
    }
938126
def flush_synced(self, using=None, **kwargs):
        
        return self._get_connection(using).indices.flush_synced(index=self._name, **kwargs)
1270063
public function syncRefresh() {
    // Disable alias since we are targeting specific uri.
    $this->config->set('drush.alias', '');

    // Sync files.
    $this->config->set('sync.files', TRUE);

    foreach ($this->getConfigValue('multisites') as $multisite) {
      $this->say("Syncing $multisite...");
      if (!$this->config->get('drush.uri')) {
        $this->config->set('drush.uri', $multisite);
      }

      $this->invokeCommand('drupal:sync:db');
      $this->invokeCommand('drupal:sync:files');
      $this->invokeCommand('drupal:update');

      $this->say("Finished syncing $multisite.");
    }
  }
618380
def sync(self):
        """"""
        self.driver.create_schema()
        self.driver.set_metadata({
            'current_version': Gauged.VERSION,
            'initial_version': Gauged.VERSION,
            'block_size': self.config.block_size,
            'resolution': self.config.resolution,
            'created_at': long(time() * 1000)
        }, replace=False)
900505
public void syncPersistNewDirectory(MutableInodeDirectory dir)
      throws InvalidPathException, FileDoesNotExistException, IOException {
    dir.setPersistenceState(PersistenceState.TO_BE_PERSISTED);
    syncPersistDirectory(dir).ifPresent(status -> {
      // If the directory already exists in the UFS, update our metadata to match the UFS.
      dir.setOwner(status.getOwner())
          .setGroup(status.getGroup())
          .setMode(status.getMode());

      Long lastModificationTime = status.getLastModifiedTime();
      if (lastModificationTime != null) {
        dir.setLastModificationTimeMs(lastModificationTime, true);
      }
    });
    dir.setPersistenceState(PersistenceState.PERSISTED);
  }
1295522
public void updateEntryPointsCache() {
        if (kBase.getAddedEntryNodeCache() != null) {
            for (EntryPointNode addedNode : kBase.getAddedEntryNodeCache()) {
                EntryPointId id = addedNode.getEntryPoint();
                if (EntryPointId.DEFAULT.equals(id)) continue;
                WorkingMemoryEntryPoint wmEntryPoint = new NamedEntryPoint(id, addedNode, this);
                entryPoints.put(id.getEntryPointId(), wmEntryPoint);
            }
        }

        if (kBase.getRemovedEntryNodeCache() != null) {
            for (EntryPointNode removedNode : kBase.getRemovedEntryNodeCache()) {
                entryPoints.remove(removedNode.getEntryPoint().getEntryPointId());
            }
        }
    }
781457
private void syncInternal() throws IOException {
        syncCompactor();
        fireBeforePersist();
        
        /* CALLS ORDERED: Need force _segment first and then persist
         * _addressArray. During recovery, the _addressArray can always
         * point to addresses which are valid though may not reflect the
         * most recent address update.
         */
        _segment.force();
        _addressArray.sync();
        _segmentManager.updateMeta();
        
        fireAfterPersist();
    }