Forwards the query to the leader.
423321
private CompletableFuture<QueryResponse> queryForward(QueryRequest request) {
    if (raft.getLeader() == null) {
      return CompletableFuture.completedFuture(logResponse(QueryResponse.builder()
          .withStatus(RaftResponse.Status.ERROR)
          .withError(RaftError.Type.NO_LEADER)
          .build()));
    }

    log.trace("Forwarding {}", request);
    return forward(request, raft.getProtocol()::query)
        .exceptionally(error -> QueryResponse.builder()
            .withStatus(RaftResponse.Status.ERROR)
            .withError(RaftError.Type.NO_LEADER)
            .build())
        .thenApply(this::logResponse);
  }
536659
def forwards(self, orm):
        ""
        for tag in orm['tagging.Tag'].objects.all():
            if tag.tagtitle_set.all().count() == 0:
                orm['tagging_translated.TagTitle'].objects.create(
                    trans_name=tag.name, tag=tag, language='en')
768061
function forwardSearch() {
      cameFrom = open1Set.pop();
      if (cameFrom.closed) {
        return;
      }

      cameFrom.closed = true;

      if (cameFrom.f1 < lMin && (cameFrom.g1 + f2 - heuristic(from, cameFrom.node)) < lMin) {
        graph.forEachLinkedNode(cameFrom.node.id, forwardVisitor);
      }

      if (open1Set.length > 0) {
        // this will be used in reverse search
        f1 = open1Set.peek().f1;
      } 
    }
669421
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        if not db.dry_run:
            orm['gnotty.IRCMessage'].objects.filter(message="joins").update(join_or_leave=True)
            orm['gnotty.IRCMessage'].objects.filter(message="leaves").update(join_or_leave=True)
862777
def forwards(self, orm):
        ""
        for a in orm.Article.objects.all():
            if a.updated:
                a.last_updated = a.updated
                a.save(force_update=True)
1279215
def forward(self, request: Request):
        
        key = request.key
        num_replicas = self.replicas.num_replicas
        logger.debug('{} forwarding request {} to {} replicas'
                     .format(self, key, num_replicas))
        self.replicas.pass_message(ReqKey(key))
        self.monitor.requestUnOrdered(key)
        self.requests.mark_as_forwarded(request, num_replicas)
304739
def forwards(self, orm):
        ""
        for node in orm.FileNode.objects.all():
            node.save()
778069
def send_token_email(self, request, queryset):
        
        for token in queryset:
            if not token.expired: forward_token(token)
1286026
def forwards(self, orm):
        ""
        # Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
        for c in orm["contenttypes.contenttype"].objects.all():
            if c.app_label == "DublinCore":
                c.app_label = "dublincore"
                c.save()
352220
public void forward(ServletRequest request, ServletResponse response)
			throws ServletException, IOException {
		if(request != null) {
			((SipServletRequest)request).getSession().setHandler(handler.getName());
		} else {
			((SipServletResponse)response).getSession().setHandler(handler.getName());
		}
		Servlet servlet = handler.allocate();
		servlet.service(request, response);
		handler.deallocate(servlet);
	}
551938
protected CompletableFuture<QueryResponse> applyQuery(QueryEntry entry, CompletableFuture<QueryResponse> future) {
    // In the case of the leader, the state machine is always up to date, so no queries will be queued and all query
    // indexes will be the last applied index.
    context.getStateMachine().<ServerStateMachine.Result>apply(entry).whenComplete((result, error) -> {
      completeOperation(result, QueryResponse.builder(), error, future);
      entry.release();
    });
    return future;
  }
842105
def forwards(self, orm):
        ""
        for instance in orm.LocationSource.objects.all():
            try:
                instance.user = instance.points.all()[0].user
                instance.save()
            except IndexError:
                # No points for this source.
                instance.delete()
1103670
def forwards(self, orm):
        ""
        orm.Project.objects.update(label=F('name'))
        orm.Cohort.objects.update(label=F('name'))
        orm.Sample.objects.update(name=F('label'))
199955
private void advance() {
        while (nextSubgraphs.isEmpty() && vertexIter.hasNext()) {
            Integer nextVertex = vertexIter.next();
            // Determine the set of vertices that are greater than this vertex
            Set<Integer> extension = new HashSet<Integer>();
            for (Integer v : g.getNeighbors(nextVertex))
                if (v > nextVertex)
                    extension.add(v);
            Set<Integer> subgraph = new HashSet<Integer>();
            subgraph.add(nextVertex);
            extendSubgraph(subgraph, extension, nextVertex);
        }
    }
1185118
def forwards(self, orm):
        ""
        for category in orm['document_library.DocumentCategory'].objects.all():
            for trans_old in orm['document_library.DocumentCategoryTitle'].objects.filter(category=category):
                orm['document_library.DocumentCategoryTranslation'].objects.create(
                    master=category,
                    language_code=trans_old.language,
                    title=trans_old.title,
                )

        for document in orm['document_library.Document'].objects.all():
            for trans_old in orm['document_library.DocumentTitle'].objects.filter(document=document):
                orm['document_library.DocumentTranslation'].objects.create(
                    master=document,
                    language_code=trans_old.language,
                    title=trans_old.title,
                    description=trans_old.description,
                    filer_file=trans_old.filer_file,
                    thumbnail=trans_old.thumbnail,
                    copyright_notice=trans_old.copyright_notice,
                    is_published=trans_old.is_published,
                    meta_description=trans_old.meta_description,
                )
775799
public static Message buildQueryReply(String leader) {
    QueryReply reply = QueryReply.newBuilder()
                                 .setLeader(leader)
                                 .build();
    return Message.newBuilder().setType(MessageType.QUERY_LEADER_REPLY)
                               .setReply(reply)
                               .build();
  }
499374
public static void forward(
		String contextRelativePath,
		RequestDispatcher dispatcher,
		HttpServletRequest request,
		HttpServletResponse response,
		Map<String,?> args
	) throws ServletException, IOException {
		// Track original page when first accessed
		final String oldOriginal = getOriginalPage(request);
		try {
			// Set original request path if not already set
			if(oldOriginal == null) {
				setOriginalPage(request, request.getServletPath());
			}
			// Keep old dispatch page to restore
			final String oldDispatchPage = getDispatchedPage(request);
			try {
				// Store as new relative path source
				setDispatchedPage(request, contextRelativePath);
				// Keep old arguments to restore
				final Object oldArgs = request.getAttribute(Dispatcher.ARG_MAP_REQUEST_ATTRIBUTE_NAME);
				try {
					// Set new arguments
					request.setAttribute(
						Dispatcher.ARG_MAP_REQUEST_ATTRIBUTE_NAME,
						args==null ? null : AoCollections.optimalUnmodifiableMap(args)
					);
					// Perform dispatch
					dispatcher.forward(request, response);
				} finally {
					// Restore any previous args
					request.setAttribute(Dispatcher.ARG_MAP_REQUEST_ATTRIBUTE_NAME, oldArgs);
				}
			} finally {
				setDispatchedPage(request, oldDispatchPage);
			}
		} finally {
			if(oldOriginal == null) {
				setOriginalPage(request, null);
			}
		}
	}