Here are the examples of the java api com.google.common.collect.ImmutableMap.of() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
7611 Examples
19
Source : InfoSchemaRecordGenerator.java
with Apache License 2.0
from zpochen
with Apache License 2.0
from zpochen
protected boolean shouldVisitCatalog() {
if (filter == null) {
return true;
}
final Map<String, String> recordValues = ImmutableMap.of(CATS_COL_CATALOG_NAME, IS_CATALOG_NAME);
// If the filter evaluates to false then we don't need to visit the catalog.
// For other two results (TRUE, INCONCLUSIVE) continue to visit the catalog.
return filter.evaluate(recordValues) != Result.FALSE;
}
19
Source : InfoSchemaRecordGenerator.java
with Apache License 2.0
from zpochen
with Apache License 2.0
from zpochen
protected boolean shouldVisitColumn(String schemaName, String tableName, String columnName) {
if (filter == null) {
return true;
}
final Map<String, String> recordValues = ImmutableMap.of(CATS_COL_CATALOG_NAME, IS_CATALOG_NAME, SHRD_COL_TABLE_SCHEMA, schemaName, SCHS_COL_SCHEMA_NAME, schemaName, SHRD_COL_TABLE_NAME, tableName, COLS_COL_COLUMN_NAME, columnName);
// If the filter evaluates to false then we don't need to visit the column.
// For other two results (TRUE, INCONCLUSIVE) continue to visit the column.
return filter.evaluate(recordValues) != Result.FALSE;
}
19
Source : PhysicalExpressionCompilerTest.java
with Apache License 2.0
from yahoo
with Apache License 2.0
from yahoo
private Map<String, OperatorNode<PhysicalExprOperator>> lr(OperatorNode<PhysicalExprOperator> left, OperatorNode<PhysicalExprOperator> right) {
return ImmutableMap.of("left", left, "right", right);
}
19
Source : StreamValue.java
with Apache License 2.0
from yahoo
with Apache License 2.0
from yahoo
public static OperatorNode<StreamOperator> setTail(OperatorNode<StreamOperator> target, Location location, StreamOperator operator, Object... arguments) {
switch(target.getOperator()) {
case SINK:
{
if (operator == StreamOperator.SINK) {
return OperatorNode.createAs(location, ImmutableMap.<String, Object>of(), operator, arguments);
} else {
Object[] args = new Object[arguments == null ? 1 : 1 + arguments.length];
args[0] = target;
if (arguments != null) {
System.arraycopy(arguments, 0, args, 1, arguments.length);
}
return OperatorNode.createAs(location, ImmutableMap.<String, Object>of(), operator, args);
}
}
case DISTINCT:
case FLATTEN:
case FILTER:
case OFFSET:
case LIMIT:
case SLICE:
case ORDERBY:
case HASH_JOIN:
case OUTER_HASH_JOIN:
case TRANSFORM:
case SCATTER:
case GROUPBY:
{
Object[] oldArguments = target.getArguments();
Object[] newArguments = new Object[oldArguments.length];
newArguments[0] = setTail((OperatorNode<StreamOperator>) oldArguments[0], location, operator, arguments);
System.arraycopy(oldArguments, 1, newArguments, 1, oldArguments.length - 1);
return OperatorNode.createAs(target.getLocation(), target.getAnnotations(), target.getOperator(), newArguments);
}
default:
throw new UnsupportedOperationException("Unknown stream operator: " + target);
}
}
19
Source : VariableMapTest.java
with GNU General Public License v2.0
from xgdsmileboy
with GNU General Public License v2.0
from xgdsmileboy
public void testFromBytesComplex1() throws ParseException {
// Verify we get out what we put in.
cycleTest(ImmutableMap.of("AAA[':f']", "a"));
// Verify the file format is as expected.
VariableMap in = new VariableMap(ImmutableMap.of("AAA[':f']", "a"));
replacedertEqual(in.toBytes(), "AAA['\\:f']:a\n".getBytes());
}
19
Source : VariableMapTest.java
with GNU General Public License v2.0
from xgdsmileboy
with GNU General Public License v2.0
from xgdsmileboy
public void testCycle1() throws ParseException {
cycleTest(ImmutableMap.of("AAA", "a", "BBB", "b"));
cycleTest(ImmutableMap.of("AA:AA", "a", "BB:BB", "b"));
cycleTest(ImmutableMap.of("AAA", "a:a", "BBB", "b:b"));
}
19
Source : ChromeScreenshoter.java
with MIT License
from WileyLabs
with MIT License
from WileyLabs
private Object sendEvaluate(String script) {
Response response = sendCommandViaRestreplacedured("Runtime.evaluate", ImmutableMap.of("returnByValue", true, "expression", script));
return response.jsonPath().get("value.result.value");
}
19
Source : ChromeScreenshoter.java
with MIT License
from WileyLabs
with MIT License
from WileyLabs
<X> X getFullScreenshotAs(OutputType<X> outputType) {
Object metrics = sendEvaluate("({" + "width: Math.max(window.innerWidth,doreplacedent.body.scrollWidth,doreplacedent.doreplacedentElement.scrollWidth)|0," + "height: Math.max(window.innerHeight,doreplacedent.body.scrollHeight,doreplacedent.doreplacedentElement.scrollHeight)|0," + "deviceScaleFactor: window.devicePixelRatio || 1," + "mobile: typeof window.orientation !== 'undefined'" + "})");
sendCommandViaRestreplacedured("Emulation.setDeviceMetricsOverride", metrics);
Response result = sendCommandViaRestreplacedured("Page.captureScreenshot", ImmutableMap.of("format", "png", "fromSurface", true));
sendCommandViaRestreplacedured("Emulation.clearDeviceMetricsOverride", ImmutableMap.of());
String base64EncodedPng = result.jsonPath().get("value.data");
return outputType.convertFromBase64Png(base64EncodedPng);
}
19
Source : FormResource.java
with Apache License 2.0
from wengwh
with Apache License 2.0
from wengwh
@GetMapping(value = "/process-forms/{processDefinitionId}/{taskDefinitionKey}/key", name = "获取流程任务的表单key")
public Map<String, String> getTaskFormKey(@PathVariable String processDefinitionId, @PathVariable String taskDefinitionKey) {
String key = formService.getTaskFormKey(processDefinitionId, taskDefinitionKey);
return ImmutableMap.of("key", key);
}
19
Source : WeCubePluginServiceEntityUpdateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void ci_data_update_should_return_error_for_input_with_missing_data_entries() throws Exception {
String ciTypeName = generateCiTypeName();
givenAppliedCiType(ciTypeName);
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_UPDATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", ciTypeName));
}
19
Source : WeCubePluginServiceEntityUpdateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void ci_data_update_should_return_error_for_input_with_invalid_enreplacedy_name() throws Exception {
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_UPDATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", "invalidEnreplacedyName", "ciData", ImmutableMap.of("code", "code")));
}
19
Source : WeCubePluginServiceEntityQueryApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void ci_data_query_should_return_error_for_input_with_missing_enreplacedy_name() throws Exception {
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_QUERY_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1"));
}
19
Source : WeCubePluginServiceEntityDeleteApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void ci_data_delete_should_return_error_for_input_with_missing_guid() throws Exception {
String ciTypeName = generateCiTypeName();
givenAppliedCiType(ciTypeName);
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_DELETE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", ciTypeName));
}
19
Source : WeCubePluginServiceEntityDeleteApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void ci_data_delete_should_return_error_for_input_with_invalid_enreplacedy_name() throws Exception {
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_DELETE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", "invalidEnreplacedyName", "guid", "guid"));
}
19
Source : WeCubePluginServiceEntityCreateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void ci_data_create_should_return_error_for_input_with_missing_enreplacedy_name() throws Exception {
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_CREATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1"));
}
19
Source : WeCubePluginServiceEntityCreateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void ci_data_create_should_return_error_for_input_with_missing_data_entries() throws Exception {
String ciTypeName = generateCiTypeName();
givenAppliedCiType(ciTypeName);
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_CREATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", ciTypeName));
}
19
Source : WeCubePluginServiceEntityCreateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void ci_data_create_should_return_error_for_input_with_invalid_enreplacedy_name() throws Exception {
replacedertErrorOutputForInvalidRequestInput(ENreplacedIES_CREATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", "invalidEnreplacedyName", "ciData", ImmutableMap.of("code", "code")));
}
19
Source : WeCubePluginServiceDataAttributeUpdateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void ci_data_attribute_update_should_return_error_for_input_with_missing_attr_name() throws Exception {
String ciTypeName = generateCiTypeName();
int ciTypeId = givenAppliedCiType(ciTypeName);
Map<String, Object> createdCiData = givenCiData(ciTypeId, ImmutableMap.of("code", "code"));
String guid = String.valueOf(createdCiData.get("guid"));
replacedertErrorOutputForInvalidRequestInput(DATA_ATTRIBUTE_UPDATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", ciTypeName, "guid", guid, "attrVal", "updatedCode"));
}
19
Source : WeCubePluginServiceDataAttributeUpdateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void ci_data_attribute_update_should_return_error_for_input_with_invalid_enreplacedy_name() throws Exception {
replacedertErrorOutputForInvalidRequestInput(DATA_ATTRIBUTE_UPDATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", "invalidEnreplacedyName"));
}
19
Source : WeCubePluginServiceDataAttributeUpdateApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void ci_data_attribute_update_should_return_error_for_input_with_missing_guid() throws Exception {
String ciTypeName = generateCiTypeName();
int ciTypeId = givenAppliedCiType(ciTypeName);
givenCiData(ciTypeId, ImmutableMap.of("code", "code"));
replacedertErrorOutputForInvalidRequestInput(DATA_ATTRIBUTE_UPDATE_URL, ImmutableMap.of(CALLBACK_PARAMETER_KEY, "1", "enreplacedyName", ciTypeName, "attrName", "code", "attrVal", "code"));
}
19
Source : WeCubeDataModelApiControllerTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void ci_data_query_should_succeed_and_return_matched_ci_data() throws Exception {
String ciTypeName = generateCiTypeName();
int ciTypeId = givenAppliedCiType(ciTypeName);
String expectedCode = "code";
Map<String, Object> createdDataMap = givenCiData(ciTypeId, ImmutableMap.of("code", expectedCode));
String guidToQuery = String.valueOf(createdDataMap.get("guid"));
Map<String, Object> criteriaMap = ImmutableMap.of("attrName", "guid", "condition", guidToQuery);
Map<String, Object> querySpecMap = ImmutableMap.of("criteria", criteriaMap);
String requestBody = new ObjectMapper().writeValuereplacedtring(querySpecMap);
mvc.perform(post("/enreplacedies/{enreplacedy-name}/query", ciTypeName).contentType(MediaType.APPLICATION_JSON).content(requestBody)).andExpect(status().isOk()).andExpect(jsonPath("$.status").value(SUCCESS_STATUS)).andExpect(jsonPath("$.message").value(SUCCESS_MESSAGE)).andExpect(jsonPath("$.data.length()").value(1)).andExpect(jsonPath("$.data[0].id").value(guidToQuery)).andExpect(jsonPath("$.data[0].guid").value(guidToQuery)).andExpect(jsonPath("$.data[0].code").value(expectedCode));
}
19
Source : AbstractBaseWeCubePluginServiceApiTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
protected void replacedertReturnSuccessForEmptyInputList(String url) throws Exception {
String requestBody = new ObjectMapper().writeValuereplacedtring(ImmutableMap.of("inputs", Collections.emptyList()));
mvc.perform(post(url).contentType(MediaType.APPLICATION_JSON).content(requestBody)).andExpect(status().isOk()).andExpect(jsonPath("$.resultCode").value(SUCCESS_RESULT_CODE)).andExpect(jsonPath("$.resultMessage").value(SUCCESS_RESULT_MESSAGE)).andExpect(jsonPath("$.results.outputs").isEmpty());
}
19
Source : WecubeAdapterService.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
private Map<String, Object> buildSuccessResult(String callbackParameter, String dataKeyName, Object data) {
return buildSuccessResult(callbackParameter, ImmutableMap.of(dataKeyName, data));
}
19
Source : AuthorizationServiceImplTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
@Transactional
public void givenExecutionPermissionsGrantedOnCiTypeAttributeLevelWhenPerformingExecutionThenShouldBePermitted() {
int ciTypeId = 1007;
Map ciData = ImmutableMap.of("guid", "1007_1000000001", "subsys_design", "1002_1000000013", "env", 141);
authorizationService.authorizeCiData(ciTypeId, ciData, ACTION_EXECUTION);
}
19
Source : AuthorizationServiceImplTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test(expected = CmdbAccessDeniedException.clreplaced)
public void givenNoPermissionSetupForEnquiryActionWhenPerformingEnquiryThenShouldBeDenied() throws CmdbAccessDeniedException {
int ciTypeId = 1007;
Map ciData = ImmutableMap.of("guid", "1007_1000000001", "subsys_design", "1002_1000000013", "env", 99);
authorizationService.authorizeCiData(ciTypeId, ciData, ACTION_ENQUIRY);
}
19
Source : AuthorizationServiceImplTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void givenCreationPermissionsGrantedOnCiTypeLevelWhenPerformingCreationThenShouldBePermitted() {
int ciTypeId = 1007;
Map ciData = ImmutableMap.of("guid", "1007_1000000001", "subsys_design", "1002_1000000013", "env", 49);
authorizationService.authorizeCiData(ciTypeId, ciData, ACTION_CREATION);
}
19
Source : UILogControllerTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Test
public void queryLogWithSorting() throws Exception {
Map<String, Object> sortingMap = ImmutableMap.of("asc", true, "field", "createdDate");
Map<String, Object> requestMap = ImmutableMap.of("sorting", sortingMap);
mvc.perform(post("/ui/v2/log/query").contentType(MediaType.APPLICATION_JSON).content(new ObjectMapper().writeValuereplacedtring(requestMap))).andExpect(status().isOk()).andExpect(jsonPath("$.statusCode", is("OK")));
;
}
19
Source : UICiDataManagementControllerTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void queryCiDataWithDefaultSortingThenReturnData() throws Exception {
int ciTypeId = givenAppliedCiType();
givenCiData(ciTypeId, ImmutableMap.of("code", "code1"));
givenCiData(ciTypeId, ImmutableMap.of("code", "code2"));
mvc.perform(post("/ui/v2/ci-types/{ci-type-id}/ci-data/query", ciTypeId).contentType(MediaType.APPLICATION_JSON).content("{}")).andExpect(jsonPath("$.statusCode", is("OK"))).andExpect(jsonPath("$.data.contents.length()", is(2))).andExpect(jsonPath("$.data.contents[0].data.code", is("code2"))).andExpect(jsonPath("$.data.contents[1].data.code", is("code1")));
}
19
Source : UICiDataManagementControllerTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void queryCiDataWithSingleSortingThenReturnData() throws Exception {
int ciTypeId = givenAppliedCiType();
givenCiData(ciTypeId, ImmutableMap.of("code", "code1"));
givenCiData(ciTypeId, ImmutableMap.of("code", "code2"));
Map<String, Object> sortingMap = ImmutableMap.of("field", "code", "asc", true);
Map<String, Object> requestMap = ImmutableMap.of("sorting", sortingMap);
String reqJson = new ObjectMapper().writeValuereplacedtring(requestMap);
mvc.perform(post("/ui/v2/ci-types/{ci-type-id}/ci-data/query", ciTypeId).contentType(MediaType.APPLICATION_JSON).content(reqJson)).andExpect(jsonPath("$.statusCode", is("OK"))).andExpect(jsonPath("$.data.contents.length()", is(2))).andExpect(jsonPath("$.data.contents[0].data.code", is("code1"))).andExpect(jsonPath("$.data.contents[1].data.code", is("code2")));
}
19
Source : UICiDataManagementControllerTest.java
with Apache License 2.0
from WeBankPartners
with Apache License 2.0
from WeBankPartners
@Transactional
@Test
public void queryCiDataWithMultipleSortingsThenReturnData() throws Exception {
int ciTypeId = givenAppliedCiType();
givenCiData(ciTypeId, ImmutableMap.of("code", "code1", "description", "description"));
givenCiData(ciTypeId, ImmutableMap.of("code", "code2", "description", "description"));
Map<String, Object> requestMap = ImmutableMap.of("sortings", Arrays.asList(ImmutableMap.of("field", "description", "asc", false), ImmutableMap.of("field", "code", "asc", true)));
String reqJson = new ObjectMapper().writeValuereplacedtring(requestMap);
mvc.perform(post("/ui/v2/ci-types/{ci-type-id}/ci-data/query", ciTypeId).contentType(MediaType.APPLICATION_JSON).content(reqJson)).andExpect(jsonPath("$.statusCode", is("OK"))).andExpect(jsonPath("$.data.contents.length()", is(2))).andExpect(jsonPath("$.data.contents[0].data.description", is("description"))).andExpect(jsonPath("$.data.contents[0].data.code", is("code1"))).andExpect(jsonPath("$.data.contents[1].data.description", is("description"))).andExpect(jsonPath("$.data.contents[1].data.code", is("code2")));
}
19
Source : ConnectionDetailsMapperTest.java
with Apache License 2.0
from viz-centric
with Apache License 2.0
from viz-centric
@Test(expected = RuntimeException.clreplaced)
public void mapToEnreplacedyThrowsExceptionForUnknownType() {
mapper.mapToEnreplacedy(ImmutableMap.of("@type", "Postgres1", "databaseName", "services", "serverIp", "domain.com", "serverPort", "1414"));
}
19
Source : ConnectionDetailsMapperTest.java
with Apache License 2.0
from viz-centric
with Apache License 2.0
from viz-centric
@Test(expected = RuntimeException.clreplaced)
public void mapToEnreplacedyThrowsExceptionIfTypeAbsent() {
mapper.mapToEnreplacedy(ImmutableMap.of("databaseName", "services", "serverIp", "domain.com", "serverPort", "1414"));
}
19
Source : MsSqlChange.java
with Apache License 2.0
from VenuMeda
with Apache License 2.0
from VenuMeda
public static Map<String, Object> offset(long changeVersion) {
return ImmutableMap.of("sys_change_version", (Object) changeVersion);
}
19
Source : ConfigurationTest.java
with MIT License
from vangav
with MIT License
from vangav
@Test
public void beAccessibleAsAMap() {
replacedertThat(exampleConfig().asMap()).hreplacedize(2).includes(entry("foo", ImmutableMap.of("bar1", "value1", "bar2", "value2")), entry("blah", "value3"));
}
19
Source : ExternalApiPuppeteer.java
with MIT License
from valb3r
with MIT License
from valb3r
private Map<String, String> getHeaders(String name) {
Map<String, String> headers = clientHeaders.get(name);
if (null == headers) {
return ImmutableMap.of();
}
return headers;
}
19
Source : TheRockTradingClient.java
with MIT License
from valb3r
with MIT License
from valb3r
@Override
protected Map<String, CurrencyPair> tickerConfig() {
// It is global subs, so return fake entry
return ImmutableMap.of("BTC", new CurrencyPair(null, null));
}
19
Source : TestTablesample.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
@BeforeClreplaced
public void setUp() throws Exception {
queryRunner = LocalQueryRunner.create(TEST_SESSION);
queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
replacedertions = new Queryreplacedertions(queryRunner);
}
19
Source : TestJoinQueriesWithoutDynamicFiltering.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
@Override
protected QueryRunner createQueryRunner() throws Exception {
return TpchQueryRunnerBuilder.builder().setExtraProperties(ImmutableMap.of("enable-dynamic-filtering", "false")).build();
}
19
Source : TestDictionaryAggregation.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
@Override
protected QueryRunner createQueryRunner() {
LocalQueryRunner queryRunner = LocalQueryRunner.create(testSessionBuilder().setSystemProperty(DICTIONARY_AGGREGATION, "true").setSystemProperty(JOIN_REORDERING_STRATEGY, NONE.toString()).build());
queryRunner.createCatalog("tpch", new TpchConnectorFactory(1), ImmutableMap.of());
return queryRunner;
}
19
Source : TestQueryRunnerUtil.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
public static DistributedQueryRunner createQueryRunner() throws Exception {
return createQueryRunner(ImmutableMap.of());
}
19
Source : TestBeginQuery.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
@BeforeClreplaced
public void setUp() {
metadata = new TestMetadata();
getQueryRunner().installPlugin(new TestPlugin(metadata));
getQueryRunner().installPlugin(new TpchPlugin());
getQueryRunner().createCatalog("test", "test", ImmutableMap.of());
getQueryRunner().createCatalog("tpch", "tpch", ImmutableMap.of());
}
19
Source : TestingKafka.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
public <K, V> RecordMetadata sendMessages(Stream<ProducerRecord<K, V>> recordStream) {
return sendMessages(recordStream, ImmutableMap.of());
}
19
Source : StandaloneQueryRunner.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
public void createCatalog(String catalogName, String connectorName) {
createCatalog(catalogName, connectorName, ImmutableMap.of());
}
19
Source : AbstractTestWindowQueries.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
@Test
public void testWindowMapAgg() {
MaterializedResult actual = computeActual("" + "SELECT map_agg(orderkey, orderpriority) OVER(PARreplacedION BY orderstatus) FROM\n" + "(SELECT * FROM orders ORDER BY orderkey LIMIT 5) t");
MaterializedResult expected = resultBuilder(getSession(), mapType(BIGINT, VarcharType.createVarcharType(1))).row(ImmutableMap.of(1L, "5-LOW", 2L, "1-URGENT", 4L, "5-LOW")).row(ImmutableMap.of(1L, "5-LOW", 2L, "1-URGENT", 4L, "5-LOW")).row(ImmutableMap.of(1L, "5-LOW", 2L, "1-URGENT", 4L, "5-LOW")).row(ImmutableMap.of(3L, "5-LOW", 5L, "5-LOW")).row(ImmutableMap.of(3L, "5-LOW", 5L, "5-LOW")).build();
replacedertEqualsIgnoreOrder(actual.getMaterializedRows(), expected.getMaterializedRows());
}
19
Source : MultinodeHiveCaching.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
@Override
public void extendEnvironment(Environment.Builder builder) {
builder.configureContainer(COORDINATOR, container -> container.withCopyFileToContainer(forHostPath(configDir.getPath("multinode/multinode-master-jvm.config")), CONTAINER_PRESTO_JVM_CONFIG).withCopyFileToContainer(forHostPath(dockerFiles.getDockerFilesHostPath("common/standard-multinode/multinode-master-config.properties")), CONTAINER_PRESTO_CONFIG_PROPERTIES).withCopyFileToContainer(forHostPath(dockerFiles.getDockerFilesHostPath("common/hadoop/hive.properties")), CONTAINER_PRESTO_HIVE_NON_CACHED_PROPERTIES).withCopyFileToContainer(forHostPath(configDir.getPath("multinode-cached/hive-coordinator.properties")), CONTAINER_PRESTO_HIVE_PROPERTIES).withTmpFs(ImmutableMap.of("/tmp/cache", "rw")));
createPrestoWorker(builder, 0);
createPrestoWorker(builder, 1);
}
19
Source : ImmutableLdapObjectDefinitions.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
private static ImmutableMap<String, List<String>> getAttributes(List<String> groupNames, String groupOrganizationName, String relation) {
return ImmutableMap.of(relation, groupNames.stream().map(groupName -> format("cn=%s,%s", groupName, groupOrganizationName)).collect(Collectors.toList()));
}
19
Source : ImmutableLdapObjectDefinitions.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
public static LdapObjectDefinition buildLdapOrganizationObject(String id, String distinguishedName, String unit) {
return LdapObjectDefinition.builder(id).setDistinguishedName(distinguishedName).setAttributes(ImmutableMap.of("ou", unit)).setObjectClreplacedes(Arrays.asList("top", "organizationalUnit")).build();
}
19
Source : ImmutableLdapObjectDefinitions.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
public static LdapObjectDefinition buildLdapGroupObject(String groupName, String groupOrganizationName, String userName, String userOrganizationName, Optional<List<String>> childGroupNames, Optional<String> childGroupOrganizationName) {
if (childGroupNames.isPresent() && childGroupOrganizationName.isPresent()) {
return LdapObjectDefinition.builder(groupName).setDistinguishedName(format("cn=%s,%s", groupName, groupOrganizationName)).setAttributes(ImmutableMap.of("cn", groupName, "member", format("uid=%s,%s", userName, userOrganizationName))).setModificationAttributes(getAttributes(childGroupNames.get(), childGroupOrganizationName.get(), MEMBER)).setObjectClreplacedes(Arrays.asList("groupOfNames")).build();
} else {
return LdapObjectDefinition.builder(groupName).setDistinguishedName(format("cn=%s,%s", groupName, groupOrganizationName)).setAttributes(ImmutableMap.of("cn", groupName, "member", format("uid=%s,%s", userName, userOrganizationName))).setObjectClreplacedes(Arrays.asList("groupOfNames")).build();
}
}
19
Source : ImmutableLdapObjectDefinitions.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
public static LdapObjectDefinition buildLdapUserObject(String userName, String userOrganizationName, Optional<List<String>> groupNames, Optional<String> groupOrganizationName, String preplacedword) {
if (groupNames.isPresent() && groupOrganizationName.isPresent()) {
return LdapObjectDefinition.builder(userName).setDistinguishedName(format("uid=%s,%s", userName, userOrganizationName)).setAttributes(ImmutableMap.of("cn", userName, "sn", userName, "userPreplacedword", preplacedword)).setObjectClreplacedes(Arrays.asList("person", "inetOrgPerson")).setModificationAttributes(getAttributes(groupNames.get(), groupOrganizationName.get(), MEMBER_OF)).build();
} else {
return LdapObjectDefinition.builder(userName).setDistinguishedName(format("uid=%s,%s", userName, userOrganizationName)).setAttributes(ImmutableMap.of("cn", userName, "sn", userName, "userPreplacedword", preplacedword)).setObjectClreplacedes(Arrays.asList("person", "inetOrgPerson")).build();
}
}
19
Source : TestHiveStorageFormats.java
with Apache License 2.0
from trinodb
with Apache License 2.0
from trinodb
private static StorageFormat storageFormat(String name) {
return storageFormat(name, ImmutableMap.of());
}
See More Examples