updates the engine when a update is available

@return has updated
@throws IOException
@throws ServletException
559817
private boolean removeUpdate() throws IOException, ServletException {
	final File patchDir = getPatchDirectory();
	final File[] patches = patchDir.listFiles(new ExtensionFilter(new String[] { "rc", "rcs" }));

	for (int i = 0; i < patches.length; i++)
	    if (!patches[i].delete()) patches[i].deleteOnExit();
	_restart();
	return true;
    }
693589
@SuppressWarnings("unchecked")
  public void updateExecutions() {
    this.updaterStage.set("Starting update all flows.");
    final Map<Optional<Executor>, List<ExecutableFlow>> exFlowMap = getFlowToExecutorMap();
    final ArrayList<ExecutableFlow> finalizeFlows =
        new ArrayList<>();

    for (final Map.Entry<Optional<Executor>, List<ExecutableFlow>> entry : exFlowMap
        .entrySet()) {

      final Optional<Executor> executorOption = entry.getKey();
      if (!executorOption.isPresent()) {
        for (final ExecutableFlow flow : entry.getValue()) {
          logger.warn("Finalizing execution " + flow.getExecutionId()
              + ". Executor id of this execution doesn't exist");
          finalizeFlows.add(flow);
        }
        continue;
      }
      final Executor executor = executorOption.get();

      this.updaterStage.set("Starting update flows on " + executor.getHost() + ":"
          + executor.getPort());

      Map<String, Object> results = null;
      try {
        results = this.apiGateway.updateExecutions(executor, entry.getValue());
      } catch (final ExecutorManagerException e) {
        handleException(entry, executor, e, finalizeFlows);
      }

      if (results != null) {
        final List<Map<String, Object>> executionUpdates =
            (List<Map<String, Object>>) results
                .get(ConnectorParams.RESPONSE_UPDATED_FLOWS);
        for (final Map<String, Object> updateMap : executionUpdates) {
          try {
            final ExecutableFlow flow = updateExecution(updateMap);

            this.updaterStage.set("Updated flow " + flow.getExecutionId());

            if (ExecutionControllerUtils.isFinished(flow)) {
              finalizeFlows.add(flow);
            }
          } catch (final ExecutorManagerException e) {
            final ExecutableFlow flow = e.getExecutableFlow();
            logger.error(e);

            if (flow != null) {
              logger.warn("Finalizing execution " + flow.getExecutionId());
              finalizeFlows.add(flow);
            }
          }
        }
      }
    }

    this.updaterStage.set("Finalizing " + finalizeFlows.size() + " error flows.");

    for (final ExecutableFlow flow : finalizeFlows) {
      this.executionFinalizer
          .finalizeFlow(flow, "Not running on the assigned executor (any more)", null);
    }

    this.updaterStage.set("Updated all active flows. Waiting for next round.");
  }
832324
@Override
    public int executeUpdate() throws SQLException
    {
        checkClosed();
        if (!this.Query.isOfType(VoltSQL.TYPE_EXEC,VoltSQL.TYPE_UPDATE)) {
            throw SQLError.get(SQLError.ILLEGAL_STATEMENT, this.Query.toSqlString());
        }
        int result = this.executeUpdate(this.Query.getExecutableQuery(this.parameters));
        this.parameters = this.Query.getParameterArray();
        return result;
    }
944515
private synchronized void updateLocal() throws ScheduleManagerException {
    final List<Schedule> updates = this.loader.loadUpdatedSchedules();
    for (final Schedule s : updates) {
      if (s.getStatus().equals(TriggerStatus.EXPIRED.toString())) {
        onScheduleExpire(s);
      } else {
        internalSchedule(s);
      }
    }
  }
1349768
@Override
    public int executeUpdate(String updateSql) throws JdbcServerException {
        log.info("Received execute update request: " + updateSql);
        Message response = handleMessageAndCheckResponse(JdbcMessage.execute(updateSql));
        return Optional.ofNullable(
                response.getHeader(JdbcMessageHeaders.JDBC_ROWS_UPDATED))
                .map(Object::toString).map(Integer::valueOf)
                .orElse(0);
    }
1227415
public int update() throws SQLException {
		checkForDao();
		@SuppressWarnings("unchecked")
		T t = (T) this;
		return dao.update(t);
	}
999934
public OKPacket update(String updateString) throws IOException {
        QueryCommandPacket cmd = new QueryCommandPacket();
        cmd.setQueryString(updateString);
        byte[] bodyBytes = cmd.toBytes();
        PacketManager.writeBody(connector.getChannel(), bodyBytes);

        logger.debug("read update result...");
        byte[] body = PacketManager.readBytes(connector.getChannel(),
            PacketManager.readHeader(connector.getChannel(), 4).getPacketBodyLength());
        if (body[0] < 0) {
            ErrorPacket packet = new ErrorPacket();
            packet.fromBytes(body);
            throw new IOException(packet + "\n with command: " + updateString);
        }

        OKPacket packet = new OKPacket();
        packet.fromBytes(body);
        return packet;
    }
1311535
private void updateConnecting() throws IOException
    {
        if (clientId == -1)
        {
            // Receive id
            clientId = in.readByte();
            // Send the name
            out.writeByte(NetworkMessageSystemId.CONNECTING);
            out.writeByte(clientId);
            final byte[] data = clientName.getBytes(NetworkMessage.CHARSET);
            out.writeByte(data.length);
            out.write(data);
            out.flush();
            Verbose.info("Client: Performing connection to the server...");
        }
    }
1213700
private void updateOtherClientConnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientConnected(Byte.valueOf(cid), cname);
        }
    }
20112
synchronized boolean update() {
        int elected = this.elected;
        int oldelected = this.oldelected;
        int lbfactor = this.lbfactor;
        if (lbfactor > 0) {
            this.lbstatus = ((elected - oldelected) * 1000) / lbfactor;
        }
        this.oldelected = elected;
        return elected != oldelected; // ping if they are equal
    }
887743
public Optional<T> updateResource() {
        return JMOptional.getOptional(JMRestfulResource
                .getStringWithRestOrClasspathOrFilePath(restfulResourceUrl))
                .filter(getEquals(cachedJsonString).negate())
                .filter(peek(this::setJsonStringCache))
                .map(jsonString -> JMJson.withJsonString(jsonString,
                        typeReference))
                .filter(peek(resource -> this.cachedResource = resource));
    }
942372
private void updateOtherClientDisconnected() throws IOException
    {
        final byte cid = in.readByte();
        final String cname = readString();
        for (final ConnectionListener listener : listeners)
        {
            listener.notifyClientDisconnected(Byte.valueOf(cid), cname);
        }
    }
474115
private void doUpdate() throws PageException, SearchException, IOException {
	// check attributes
	required("index", action, "collection", collection);
	required("index", action, "key", key);

	if (type == -1) type = (query == null) ? SearchIndex.TYPE_FILE : SearchIndex.TYPE_CUSTOM;

	if (type == SearchIndex.TYPE_CUSTOM) {
	    required("index", action, "body", body);
	    // required("index",action,"query",query);
	}
	IndexResult result;

	result = collection.index(pageContext, key, type, urlpath, title, body, language, extensions, query, recurse, categoryTree, category, timeout, custom1, custom2, custom3,
		custom4);
	if (!StringUtil.isEmpty(status)) pageContext.setVariable(status, toStruct(result));
    }
1326440
public boolean needsRefreshing() {
		// is there a new version available?
		long lastmodified = new File(pathResourceDirectory,
				Parameters.lexiconName).lastModified();
		boolean needsRefreshing = false;
		if (lastmodifiedLexicon != lastmodified) {
			needsRefreshing = true;
		}
		return needsRefreshing;
	}
540880
public int updateQueue() throws IOException {
		int added = 0;
		long lastMarkPoint = lastMark.getLastMark();
		long currentMarkPoint = db.getCurrentMark();
		if(currentMarkPoint > lastMarkPoint) {
			// TODO: touchy touchy... need transactions here to not have 
			// state sync problems if something goes badly in this block..
			// for example, it would be possible to constantly enqueue the
			// same files forever..
			CloseableIterator<String> newNames = 
				db.getNamesBetweenMarks(lastMarkPoint, currentMarkPoint);
			while(newNames.hasNext()) {
				String newName = newNames.next();
				LOGGER.info("Queued " + newName + " for indexing.");
				queue.enqueue(newName);
				added++;
			}
			newNames.close();
			lastMark.setLastMark(currentMarkPoint);
		}
		return added;
	}
1186579
public void updateStatus() {
        Optional<Activity> activity = api.getActivity();
        ObjectNode updateStatus = JsonNodeFactory.instance.objectNode()
                .put("op", GatewayOpcode.STATUS_UPDATE.getCode());
        ObjectNode data = updateStatus.putObject("d")
                .put("status", api.getStatus().getStatusString())
                .put("afk", false)
                .putNull("since");
        ObjectNode activityJson = data.putObject("game");
        activityJson.put("name", activity.isPresent() ? activity.get().getName() : null);
        activityJson.put("type", activity.map(g -> g.getType().getId()).orElse(0));
        activity.ifPresent(g -> g.getStreamingUrl().ifPresent(url -> activityJson.put("url", url)));
        logger.debug("Updating status (content: {})", updateStatus);
        websocket.get().sendText(updateStatus.toString());
    }
1299028
def update(self, iterable):
        
        inserted_any = False
        for header in iterable:
            key = header.lower()
            if key not in self._set:
                self._headers.append(header)
                self._set.add(key)
                inserted_any = True
        if inserted_any and self.on_update is not None:
            self.on_update(self)