本文整理汇总了Java中jersey.repackaged.com.google.common.collect.ImmutableMap类的典型用法代码示例。如果您正苦于以下问题:Java ImmutableMap类的具体用法?Java ImmutableMap怎么用?Java ImmutableMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ImmutableMap类属于jersey.repackaged.com.google.common.collect包,在下文中一共展示了ImmutableMap类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: keepLastN
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@DELETE
@Path("/keep/last/{numPartitions}")
public APIResponse<Map<String, Integer>> keepLastN(
@PathParam("numPartitions") Integer numPartitions, @Context UriInfo info) {
long startTs = System.currentTimeMillis();
int numDeletedPartitions = cube.deleteCube(numPartitions);
int numOptimizedPartitions = cube.optimize();
long t0 = System.currentTimeMillis();
System.gc();
log.debug("GC took {}ms", System.currentTimeMillis() - t0);
return new APIResponse<>(
ImmutableMap.of(
"numDeletedPartitions", numDeletedPartitions,
"numOptimizedPartitions", numOptimizedPartitions,
"gcTimeMs", (int) (System.currentTimeMillis() - t0)),
info,
startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:19,代码来源:CubeResource.java
示例2: deleteCube
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@DELETE
@Path("/{cubeName}")
public APIResponse<Map<String, Integer>> deleteCube(
@PathParam("cubeName") String cubeName, @Context UriInfo info) {
if (!cube.hasCube(cubeName)) {
log.warn("Could not find cube {}", cubeName);
throw new NotFoundException(String.format("Could not find cube %s", cubeName));
}
long startTs = System.currentTimeMillis();
int numDeletedPartitions = cube.deleteCube(cubeName, 0);
int numOptimizedPartitions = cube.optimize();
long t0 = System.currentTimeMillis();
System.gc();
log.debug("GC took {}ms", System.currentTimeMillis() - t0);
return new APIResponse<>(
ImmutableMap.of(
"numDeletedPartitions", numDeletedPartitions,
"numOptimizedPartitions", numOptimizedPartitions,
"gcTimeMs", (int) (System.currentTimeMillis() - t0)),
info,
startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:24,代码来源:CubeResource.java
示例3: deletePartitions
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@DELETE
@Path("/all/from/{fromPartition}/to/{toPartition}")
public APIResponse<Map<String, Integer>> deletePartitions(
@PathParam("fromPartition") String fromPartition,
@PathParam("toPartition") String toPartition,
@Context UriInfo info) {
long startTs = System.currentTimeMillis();
int numDeletedPartitions = cube.deleteCube(fromPartition, toPartition);
int numOptimizedPartitions = cube.optimize();
long t0 = System.currentTimeMillis();
System.gc();
log.debug("GC took {}ms", System.currentTimeMillis() - t0);
return new APIResponse<>(
ImmutableMap.of(
"numDeletedPartitions", numDeletedPartitions,
"numOptimizedPartitions", numOptimizedPartitions,
"gcTimeMs", (int) (System.currentTimeMillis() - t0)),
info,
startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:21,代码来源:CubeResource.java
示例4: deletePartitionsOfCube
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@DELETE
@Path("/{cubeName}/from/{fromPartition}/to/{toPartition}")
public APIResponse<Map<String, Integer>> deletePartitionsOfCube(
@PathParam("cubeName") String cubeName,
@PathParam("fromPartition") String fromPartition,
@PathParam("toPartition") String toPartition,
@Context UriInfo info) {
if (!cube.hasCube(cubeName)) {
log.warn("Could not find cube {}", cubeName);
throw new NotFoundException(String.format("Could not find cube %s", cubeName));
}
long startTs = System.currentTimeMillis();
int numDeletedPartitions = cube.deleteCube(cubeName, fromPartition, toPartition);
int numOptimizedPartitions = cube.optimize();
long t0 = System.currentTimeMillis();
System.gc();
log.debug("GC took {}ms", System.currentTimeMillis() - t0);
return new APIResponse<>(
ImmutableMap.of(
"numDeletedPartitions", numDeletedPartitions,
"numOptimizedPartitions", numOptimizedPartitions,
"gcTimeMs", (int) (System.currentTimeMillis() - t0)),
info,
startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:27,代码来源:CubeResource.java
示例5: testGcpTemplateCreation
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
@Parameters({ "gcpName", "gcpInstanceType", "volumeType", "volumeCount", "volumeSize", "preemptible" })
public void testGcpTemplateCreation(@Optional("it-gcp-template") String gcpName, @Optional("n1-standard-2") String gcpInstanceType,
@Optional("pd-standard") String volumeType, @Optional("1") String volumeCount, @Optional("30") String volumeSize,
@Optional("false") Boolean preemptible) throws Exception {
// GIVEN
// WHEN
TemplateRequest templateRequest = new TemplateRequest();
templateRequest.setName(gcpName);
templateRequest.setDescription("GCP template for integration testing");
templateRequest.setCloudPlatform("GCP");
templateRequest.setInstanceType(gcpInstanceType);
templateRequest.setVolumeCount(Integer.valueOf(volumeCount));
templateRequest.setVolumeSize(Integer.valueOf(volumeSize));
templateRequest.setVolumeType(volumeType);
templateRequest.setCloudPlatform("GCP");
if (preemptible != null) {
templateRequest.setParameters(ImmutableMap.of("preemptible", preemptible));
}
String id = getCloudbreakClient().templateEndpoint().postPrivate(templateRequest).getId().toString();
// THEN
Assert.assertNotNull(id);
additionHelper.handleTemplateAdditions(getItContext(), id, additions);
}
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:25,代码来源:GcpTemplateCreationTest.java
示例6: putAll_MapContainsValues_WithMap
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
public void putAll_MapContainsValues_WithMap() {
RequestParameters parameters = new RequestParameters();
parameters.putAll(ImmutableMap.of("X", "A", "Y", "B", "Z", "C"));
Assert.assertEquals("A", parameters.get("X"));
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:9,代码来源:RequestParametersTest.java
示例7: asString_ReturnsString_ForExistingEntry
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
public void asString_ReturnsString_ForExistingEntry() {
RequestParameters parameters = new RequestParameters();
parameters.putAll(ImmutableMap.of("X", 1));
String result = parameters.asString("X");
Assert.assertEquals("1", result);
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:10,代码来源:RequestParametersTest.java
示例8: asString_ReturnsNull_ForNonExistentEntry
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
public void asString_ReturnsNull_ForNonExistentEntry() {
RequestParameters parameters = new RequestParameters();
parameters.putAll(ImmutableMap.of("X", "A"));
String result = parameters.asString("Y");
Assert.assertNull(result);
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:10,代码来源:RequestParametersTest.java
示例9: get_ReturnsValue_ForExistentKey
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
public void get_ReturnsValue_ForExistentKey() {
RequestParameters parameters = new RequestParameters();
parameters.putAll(ImmutableMap.of("X", "A"));
Object result = parameters.get("X");
Assert.assertEquals("A", result);
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:10,代码来源:RequestParametersTest.java
示例10: get_ReturnsNull_ForNonExistentKey
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
public void get_ReturnsNull_ForNonExistentKey() {
RequestParameters parameters = new RequestParameters();
parameters.putAll(ImmutableMap.of("X", "A"));
Object result = parameters.get("Y");
Assert.assertNull(result);
}
开发者ID:dotwebstack,项目名称:dotwebstack-framework,代码行数:10,代码来源:RequestParametersTest.java
示例11: insert
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@POST
@Path("/insert")
public APIResponse<Map<String, Integer>> insert(List<DataRow> rows, @Context UriInfo info) {
long startTs = System.currentTimeMillis();
cube.insert(rows);
log.info("Inserted {} rows", rows.size());
return new APIResponse<>(ImmutableMap.of("numInsertedRows", rows.size()), info, startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:9,代码来源:CubeResource.java
示例12: save
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@POST
@Path("/save")
public APIResponse<Map<String, String>> save(@Context UriInfo info) throws IOException {
final long startTs = System.currentTimeMillis();
log.info("Saving to {}", cube.getPath());
cube.save(cube.getPath());
log.info("Saving finished");
return new APIResponse<>(ImmutableMap.of("savePath", cube.getPath()), info, startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:10,代码来源:CubeResource.java
示例13: dump
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@POST
@Path("/saveJSON")
public APIResponse<Map<String, String>> dump(@Context UriInfo info) throws IOException {
final long startTs = System.currentTimeMillis();
String path = cube.getPath() + "/json";
log.info("Saving to {}", path);
cube.saveAsJson(path);
log.info("Saving finished");
return new APIResponse<>(ImmutableMap.of("savePath", path), info, startTs);
}
开发者ID:cubedb,项目名称:cubedb,代码行数:11,代码来源:CubeResource.java
示例14: ServerInfo
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
public ServerInfo(HashMap<String, WorkerState> workers) {
this.workers = ImmutableMap.copyOf(workers);
}
开发者ID:Abiy,项目名称:distGatling,代码行数:4,代码来源:Master.java
示例15: getWorkers
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
public ImmutableMap<String, WorkerState> getWorkers() {
return workers == null ? ImmutableMap.of() : workers;
}
开发者ID:Abiy,项目名称:distGatling,代码行数:4,代码来源:Master.java
示例16: getComponentMap
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Test
public void getComponentMap() throws Exception {
assertEquals(ImmutableMap.of("site", "mySite"), query.getComponentMap());
}
开发者ID:vcu-swim-lab,项目名称:stack-intheflow,代码行数:5,代码来源:QueryTest.java
示例17: getTestStatus
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@GET
@Path("status")
public Map<String, String> getTestStatus() {
return ImmutableMap.of("status", "success");
}
开发者ID:tommyschnabel,项目名称:SimpleJavaServer,代码行数:6,代码来源:TestApi.java
示例18: postWithBody
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@POST
@Path("name")
public Map<String, String> postWithBody(@QueryParam("name") String name) {
return ImmutableMap.of("name", name);
}
开发者ID:tommyschnabel,项目名称:SimpleJavaServer,代码行数:6,代码来源:TestApi.java
示例19: getParameters
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Override
public Map<String, Object> getParameters() {
return ImmutableMap.<String, Object>of("name", newEmailName, "folder", folderId);
}
开发者ID:Smartling,项目名称:marketo-rest-sdk-java,代码行数:5,代码来源:CloneEmail.java
示例20: getParameters
import jersey.repackaged.com.google.common.collect.ImmutableMap; //导入依赖的package包/类
@Override
public Map<String, Object> getParameters() {
return ImmutableMap.<String, Object>of("name", newFormName, "folder", folderId, "description", description);
}
开发者ID:Smartling,项目名称:marketo-rest-sdk-java,代码行数:5,代码来源:CloneForm.java
注:本文中的jersey.repackaged.com.google.common.collect.ImmutableMap类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论