Synchronize id<->position mappings.
181463
def update_mappings(self):
        """"""
        self.pos2id = dict((v, k) for k, v in self.id2pos.iteritems())
        assert len(self.pos2id) == len(self.id2pos), "duplicate ids or positions detected"
159512
public void sync(boolean syncAllSegments)
    {
        CommitLogSegment current = allocator.allocatingFrom();
        for (CommitLogSegment segment : allocator.getActiveSegments())
        {
            if (!syncAllSegments && segment.id > current.id)
                return;
            segment.sync();
        }
    }
160684
def _records_commit(record_ids):
    """"""
    for record_id in record_ids:
        record = Record.get_record(record_id)
        record.commit()
634232
void releaseId(Id id) {

        Integer pos = idPosMap.get(id);
        if (pos != null) {
            idPosMap.remove(id);
            freePositions.add(pos);

            for (HierarchicalTypeStore s : superTypeStores) {
                s.releaseId(id);
            }
        }
    }
1100121
void merge(final long key, final double[] values) {
    setNotEmpty();
    if (key < theta_) {
      final int index = findOrInsertKey(key);
      if (index < 0) {
        incrementCount();
        setValues(~index, values);
      } else {
        updateValues(index, values);
      }
      rebuildIfNeeded();
    }
  }
440940
private void syncKeyLocked(String key) {
    ApiType obj = this.knownObjects.getByKey(key);
    if (obj == null) {
      return;
    }

    String id = this.keyOf(obj);
    Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(id);
    if (deltas != null && !(Collections.isEmptyCollection(deltas))) {
      return;
    }

    this.queueActionLocked(DeltaType.Sync, obj);
  }
1043296
final void fillIDs(long keyPart, int intIndex, GHIntHashSet set, int depth) {
        long pointer = (long) intIndex << 2;
        if (depth == entries.length) {
            int nextIntPointer = dataAccess.getInt(pointer);
            if (nextIntPointer < 0) {
                // single data entries (less disc space)
                set.add(-(nextIntPointer + 1));
            } else {
                long max = (long) nextIntPointer * 4;
                // leaf entry => nextIntPointer is maxPointer
                for (long leafIndex = pointer + 4; leafIndex < max; leafIndex += 4) {
                    set.add(dataAccess.getInt(leafIndex));
                }
            }
            return;
        }
        int offset = (int) (bitmasks[depth] & keyPart) << 2;
        int nextIntPointer = dataAccess.getInt(pointer + offset);
        if (nextIntPointer > 0) {
            // tree entry => negative value points to subentries
            fillIDs(keyPart >>> shifts[depth], nextIntPointer, set, depth + 1);
        }
    }
444100
public void synchronize(List<QueryControllerEntity> queryEntities) {
	  if (queryEntities.size() > 0) {
			for (QueryControllerEntity queryEntity : queryEntities) {
				if (queryEntity instanceof QueryControllerGroup) {
					QueryControllerGroup group = (QueryControllerGroup) queryEntity;
					QueryGroupTreeElement queryGroupEle = new QueryGroupTreeElement(group.getID());
					Vector<QueryControllerQuery> queries = group.getQueries();
					for (QueryControllerQuery query : queries) {
						QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery());
						insertNodeInto(queryTreeEle, queryGroupEle, queryGroupEle.getChildCount());
					}
					insertNodeInto(queryGroupEle, (DefaultMutableTreeNode) root, root.getChildCount());
				} else {
					QueryControllerQuery query = (QueryControllerQuery) queryEntity;
					QueryTreeElement queryTreeEle = new QueryTreeElement(query.getID(), query.getQuery());
					insertNodeInto(queryTreeEle, (DefaultMutableTreeNode) root, root.getChildCount());
				}
			}
		}
	}
228923
public void synchronize(List<? extends E> list) {
		assert SwingUtilities.isEventDispatchThread() : ApplicationResources.accessor.getMessage("assert.notRunningInSwingEventThread");

		// Make sure the first element exists and matches
		int modelOffset;
		if(constantFirstRow!=null) {
			modelOffset = 1;
			if(isEmpty()) addElement(constantFirstRow);
			else if(!getElementAt(0).equals(constantFirstRow)) {
				insertElementAt(constantFirstRow, 0);
			}
		} else modelOffset = 0;

		// Synchronize the dynamic part of the list
		int size = list.size();
		for(int index=0; index<size; index++) {
			E obj = list.get(index);
			if(index>=(size()-modelOffset)) addElement(obj);
			else if(!obj.equals(getElementAt(index+modelOffset))) {
				// Objects don't match
				// If this object is found further down the list, then delete up to that object
				int foundIndex = -1;
				for(int searchIndex = index+1; searchIndex<(size()-modelOffset); searchIndex++) {
					if(obj.equals(getElementAt(searchIndex+modelOffset))) {
						foundIndex = searchIndex;
						break;
					}
				}
				if(foundIndex!=-1) removeRange(index+modelOffset, foundIndex-1+modelOffset);
				// Otherwise, insert in the current index
				else insertElementAt(obj, index+modelOffset);
			}
		}
		// Remove any extra
		if((size()-modelOffset) > size) removeRange(size+modelOffset, size()-1);
	}
688734
private void sync() {
    List<SwimMember> syncMembers = discoveryService.getNodes().stream()
        .map(node -> new SwimMember(MemberId.from(node.id().id()), node.address()))
        .filter(member -> !member.id().equals(localMember.id()))
        .collect(Collectors.toList());
    for (SwimMember member : syncMembers) {
      sync(member.copy());
    }
  }
1159425
protected void initSynchronizations(Element root, CmsXmlContentDefinition contentDefinition) {

        List<Element> elements = new ArrayList<Element>(CmsXmlGenericWrapper.elements(root, APPINFO_SYNCHRONIZATION));
        for (Element element : elements) {
            String elementName = element.attributeValue(APPINFO_ATTR_ELEMENT);
            m_synchronizations.add(elementName);
        }
    }
60604
def move_id_ahead(element_id, reference_id, idstr_list):
    """"""
    if element_id == reference_id:
        return idstr_list
    idstr_list.remove(str(element_id))
    reference_index = idstr_list.index(str(reference_id))
    idstr_list.insert(reference_index, str(element_id))
    return idstr_list
365426
def __sync(self):
    """"""
    pad_length = _BLOCK_SIZE - self.__reader.tell() % _BLOCK_SIZE
    if pad_length and pad_length != _BLOCK_SIZE:
      data = self.__reader.read(pad_length)
      if len(data) != pad_length:
        raise EOFError('Read %d bytes instead of %d' %
                       (len(data), pad_length))
1246461
protected void createMapping(String id) {
		DatabaseEntry key = new DatabaseEntry();
		DatabaseEntry data = new DatabaseEntry();
		IntegerBinding.intToEntry(loadCounter, key);
		StringBinding.stringToEntry(id, data);
		iidToIdDB.put(null, key, data); // required during name look-up
		idToIidDB.put(null, data, key); // required during indexing
	}
812136
void updateCount() {
		if (this.hasChanged) {
			this.positionArray = ArrayUtils.toPrimitive(getPositionList()
					.toArray(new Long[0]));
			this.hasChanged = false;
		}
	}
92293
def sync(self):
        """"""
        if self.filepath:
            serialised_file = open(self.filepath, "w")
            json.dump(self.state, serialised_file)
            serialised_file.close()
        else:
            print("Filepath to the persistence file is not set. State cannot be synced to disc.")
146316
private static Map<Elements, String> casIds() {
        Map<Elements, String> result = ids;
        if (result == null) {
            synchronized (LOCK) {
                result = ids;
                if (result == null) {
                    ids = result = initCasIds();
                }
            }
        }
        return result;
    }