Upsert data async action future.

@param jsonSource the json source
@param index      the index
@param type       the type
@param id         the id
@return the action future
540638
public ActionFuture<UpdateResponse> upsertDataAsync(
            String jsonSource, String index, String type, String id) {
        return upsertQueryAsync(
                buildPrepareUpsert(index, type, id, jsonSource));
    }
813975
public IndexResponse sendData(String jsonSource, String index, String type,
            String id) {
        return indexQuery(buildIndexRequest(jsonSource, index, type, id));
    }
10494
public <T> AsyncMutateInBuilder upsert(String path, T fragment) {
        if (StringUtil.isNullOrEmpty(path)) {
            throw new IllegalArgumentException("Path must not be empty for upsert");
        }
        this.mutationSpecs.add(new MutationSpec(Mutation.DICT_UPSERT, path, fragment));
        return this;
    }
798645
public JSONObject updateByContract(String contractId, String ts, HashMap<String, String> params) throws JSONException {   
        return oClient.put("/team/v3/snapshots/contracts/" + contractId + "/" + ts, params);
    }
687137
@PUT
    @Consumes(Servlets.JSON_MEDIA_TYPE)
    @Produces(Servlets.JSON_MEDIA_TYPE)
    @Path("/uniqueAttribute/type/{typeName}")
    public EntityMutationResponse partialUpdateEntityByUniqueAttrs(@PathParam("typeName") String typeName,
                                                                   @Context HttpServletRequest servletRequest,
                                                                   AtlasEntityWithExtInfo entityInfo) throws Exception {
        AtlasPerfTracer perf = null;

        try {
            Map<String, Object> uniqueAttributes = getAttributes(servletRequest);

            if (AtlasPerfTracer.isPerfTraceEnabled(PERF_LOG)) {
                perf = AtlasPerfTracer.getPerfTracer(PERF_LOG, "EntityREST.partialUpdateEntityByUniqueAttrs(" + typeName + "," + uniqueAttributes + ")");
            }

            AtlasEntityType entityType = ensureEntityType(typeName);

            validateUniqueAttribute(entityType, uniqueAttributes);

            return entitiesStore.updateByUniqueAttributes(entityType, uniqueAttributes, entityInfo);
        } finally {
            AtlasPerfTracer.log(perf);
        }
    }
359499
public ActionFuture<UpdateResponse>
    upsertDataASyncWithObjectMapper(Object sourceObject, String index,
            String type, String id) {
        return upsertDataAsync(
                JMElasticsearchUtil.buildSourceByJsonMapper(sourceObject),
                index, type, id);
    }
1242642
private TransactionalDataSource getTransactionalDataSource(
            ODataRequestContext odataRequestContext, Type type) throws ODataException {
        DataSource dataSource = dataSourceFactory.getDataSource(odataRequestContext, type.getFullyQualifiedName());
        String dataSourceKey = dataSource.getClass().toString();
        if (dataSourceMap.containsKey(dataSourceKey)) {
            return dataSourceMap.get(dataSourceKey);
        } else {
            TransactionalDataSource transactionalDataSource = dataSource.startTransaction();

            dataSourceMap.put(dataSourceKey, transactionalDataSource);
            return transactionalDataSource;
        }
    }
1205983
public UpdateResponse upsertDataWithObjectMapper(Object sourceObject,
            String index, String type, String id) {
        return upsertData(
                JMElasticsearchUtil.buildSourceByJsonMapper(sourceObject),
                index, type, id);
    }
1126608
public String sendData(String jsonSource, String index, String type) {
        return sendData(jsonSource, index, type, null).getId();
    }
146491
ServerMember update(Member.Type type, Instant time) {
    if (this.type != type) {
      this.type = Assert.notNull(type, "type");
      if (time.isAfter(updated)) {
        this.updated = Assert.notNull(time, "time");
      }
      if (typeChangeListeners != null) {
        typeChangeListeners.accept(type);
      }
    }
    return this;
  }
180722
public ActionFuture<IndexResponse> sendDataAsync(
            String jsonSource, String index, String type, String id) {
        return indexQueryAsync(buildIndexRequest(jsonSource, index, type, id));
    }
1109711
@SuppressWarnings("unchecked")
	@Override
	public <E> int bulkInsert(final Class<E> entityType, final Stream<E> entities,
			final InsertsCondition<? super E> condition) {
		@SuppressWarnings("rawtypes")
		EntityHandler handler = this.getEntityHandler();
		if (!handler.getEntityType().isAssignableFrom(entityType)) {
			throw new IllegalArgumentException("Entity type not supported");
		}

		try {
			TableMetadata metadata = handler.getMetadata(this.transactionManager, entityType);
			SqlContext context = handler.createBulkInsertContext(this, metadata, entityType);
			context.setSqlKind(SqlKind.BULK_INSERT);

			// IDアノテーションが付与されたカラム情報を取得する
			MappingColumn[] idColumns = MappingUtils.getIdMappingColumns(entityType);

			setGeneratedKeyColumns(context, idColumns, metadata);

			int frameCount = 0;
			int count = 0;
			List<E> entityList = new ArrayList<>();
			for (Iterator<E> iterator = entities.iterator(); iterator.hasNext();) {
				E entity = iterator.next();

				if (!entityType.isInstance(entity)) {
					throw new IllegalArgumentException("Entity types do not match");
				}

				entityList.add(entity);

				handler.setBulkInsertParams(context, entity, frameCount);
				frameCount++;

				if (condition.test(context, frameCount, entity)) {
					count += doBulkInsert(context, entityType, handler, metadata, idColumns, entityList);
					frameCount = 0;
					entityList.clear();

					// 新しいSqlContextを作成する前にgeneratedKeyColumnsを退避しておく
					String[] generatedKeyColumns = context.getGeneratedKeyColumns();
					context = handler.createBulkInsertContext(this, metadata, entityType);
					context.setSqlKind(SqlKind.BULK_INSERT);
					// 実行結果から生成されたIDを取得できるようにPreparedStatementにIDカラムを渡す
					context.setGeneratedKeyColumns(generatedKeyColumns);
				}
			}
			return count + (frameCount > 0 ? doBulkInsert(context, entityType, handler, metadata, idColumns, entityList)
					: 0);

		} catch (SQLException e) {
			throw new EntitySqlRuntimeException(SqlKind.BULK_INSERT, e);
		}
	}
773278
public String sendDataWithObjectMapper(Object sourceObject, String index,
            String type) {
        return sendDataWithObjectMapper(sourceObject, index, type, null)
                .getId();
    }
70030
public ActionFuture<UpdateResponse> upsertDataAsync(
            Map<String, ?> source, String index, String type, String id) {
        return upsertQueryAsync(buildPrepareUpsert(index, type, id, source));
    }
1141491
private Void indexUpdate(Collection<Consumer<Void>> state, Consumer<Void> indexAction) {
        if (async) {
            state.add(indexAction);
        } else {
            indexAction.accept(null);
        }
        return null;
    }
1291479
private void esIndex(String index, String id, String json, String pipeline) {
        logger.debug("Indexing {}/{}?pipeline={}", index, id, pipeline);
        logger.trace("JSon indexed : {}", json);

        if (!closed) {
            esClient.index(index, id, json, pipeline);
        } else {
            logger.warn("trying to add new file while closing crawler. Document [{}]/[{}] has been ignored", index, id);
        }
    }
1221967
public static <T extends AbstractJaxb> boolean insertAfterId(String id,
            T insObject, T target) throws TagTypeUnmatchException {
        return execute(OperationEnum.AFTER, id,
                insObject.copy(insObject.getClass()), target);
    }