target
stringlengths
20
113k
src_fm
stringlengths
11
86.3k
src_fm_fc
stringlengths
21
86.4k
src_fm_fc_co
stringlengths
30
86.4k
src_fm_fc_ms
stringlengths
42
86.8k
src_fm_fc_ms_ff
stringlengths
43
86.8k
@Test public void updateAndQueryByVersion() throws Throwable { setUpHost(false); this.host.doExampleServiceUpdateAndQueryByVersion(this.host.getUri(), (int) this.serviceCount); }
@Override public URI getUri() { return this.uri; }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
@Test public void throughputPostWithExpirationLongRunning() throws Throwable { if (this.serviceCacheClearIntervalSeconds == 0) { this.serviceCacheClearIntervalSeconds = TimeUnit.MICROSECONDS.toSeconds( ServiceHostState.DEFAULT_OPERATION_TIMEOUT_MICROS); } QueryTask queryTask = QueryTask.Builder.createDirectTask() .setQ...
public static void setExpiredDocumentSearchThreshold(int count) { expiredDocumentSearchThreshold = count; }
LuceneDocumentIndexService extends StatelessService { public static void setExpiredDocumentSearchThreshold(int count) { expiredDocumentSearchThreshold = count; } }
LuceneDocumentIndexService extends StatelessService { public static void setExpiredDocumentSearchThreshold(int count) { expiredDocumentSearchThreshold = count; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); }
LuceneDocumentIndexService extends StatelessService { public static void setExpiredDocumentSearchThreshold(int count) { expiredDocumentSearchThreshold = count; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQu...
LuceneDocumentIndexService extends StatelessService { public static void setExpiredDocumentSearchThreshold(int count) { expiredDocumentSearchThreshold = count; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQu...
@Test public void buildChildSelfLink() throws Throwable { SomeFactoryService f = new SomeFactoryService(); f = (SomeFactoryService) this.host.startServiceAndWait(f, UUID.randomUUID().toString(), null); String idHash = Utils.computeHash(this.host.getId()); assertTrue(f.buildDefaultChildSelfLink().startsWith(idHash)); lo...
protected String buildDefaultChildSelfLink() { return getHost().nextUUID(); }
FactoryService extends StatelessService { protected String buildDefaultChildSelfLink() { return getHost().nextUUID(); } }
FactoryService extends StatelessService { protected String buildDefaultChildSelfLink() { return getHost().nextUUID(); } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { protected String buildDefaultChildSelfLink() { return getHost().nextUUID(); } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption... options); static Factory...
FactoryService extends StatelessService { protected String buildDefaultChildSelfLink() { return getHost().nextUUID(); } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption... options); static Factory...
@Test public void factoryClonePostExpectFailure() throws Throwable { MinimalFactoryTestService f = new MinimalFactoryTestService(); MinimalFactoryTestService factoryService = (MinimalFactoryTestService) this.host .startServiceAndWait(f, UUID.randomUUID().toString(), null); this.host.waitForServiceAvailable(factoryServi...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
@Test public void factoryDurableServicePostWithDeleteRestart() throws Throwable { long count = this.serviceCount; MinimalFactoryTestService f = new MinimalFactoryTestService(); f.setChildServiceCaps(EnumSet.of(ServiceOption.PERSISTENCE)); MinimalFactoryTestService factoryService = (MinimalFactoryTestService) this.host ...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
@Test public void invalidSubChildPath() throws Throwable { MinimalFactoryTestService f = new MinimalFactoryTestService(); f.setChildServiceCaps(EnumSet.of(ServiceOption.PERSISTENCE)); f = (MinimalFactoryTestService) this.host .startServiceAndWait(f, UUID.randomUUID().toString(), null); this.host.waitForServiceAvailable...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
@Test public void factoryServiceRemotePost() throws Throwable { long count = 100; URI factoryUri = this.host.startServiceAndWait( MinimalFactoryTestService.class, UUID.randomUUID().toString()) .getUri(); EnumSet<TestProperty> props = EnumSet.of(TestProperty.FORCE_REMOTE); doFactoryServiceChildCreation(props, count, fac...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
@Test public void throughputFactoryServicePost() throws Throwable { long count = this.serviceCount; if (count < 1) { count = this.host.computeIterationsFromMemory(10) / 20; } URI factoryUri = this.host.startServiceAndWait( MinimalFactoryTestService.class, UUID.randomUUID().toString()) .getUri(); doFactoryServiceChildCr...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
@Test public void duplicateFactoryPostWithInitialFailure() throws Throwable { MinimalFactoryTestService factory = (MinimalFactoryTestService) this.host .startServiceAndWait( MinimalFactoryTestService.class, UUID.randomUUID().toString()); URI factoryUri = factory.getUri(); String selfLink = UUID.randomUUID().toString();...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); }
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
FactoryService extends StatelessService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } FactoryService(Class<? extends ServiceDocument> childServiceDocumentType); static FactoryService create(Class<? extends Service> childServiceType, ServiceOption.....
@Test public void throughputPostWithAuthz() throws Throwable { setUpHost(true); URI factoryUri = UriUtils.buildFactoryUri(this.host, ExampleService.class); this.host.setSystemAuthorizationContext(); List<String> userLinks = new ArrayList<>(); for (int i = 0; i < this.authUserCount; i++) { userLinks.add(buildExampleUser...
private String getSubject(Operation op) { if (op.getAuthorizationContext() != null && op.getAuthorizationContext().isSystemUser()) { return SystemUserService.SELF_LINK; } if (getHost().isAuthorizationEnabled()) { return op.getAuthorizationContext().getClaims().getSubject(); } return GuestUserService.SELF_LINK; }
LuceneDocumentIndexService extends StatelessService { private String getSubject(Operation op) { if (op.getAuthorizationContext() != null && op.getAuthorizationContext().isSystemUser()) { return SystemUserService.SELF_LINK; } if (getHost().isAuthorizationEnabled()) { return op.getAuthorizationContext().getClaims().getSu...
LuceneDocumentIndexService extends StatelessService { private String getSubject(Operation op) { if (op.getAuthorizationContext() != null && op.getAuthorizationContext().isSystemUser()) { return SystemUserService.SELF_LINK; } if (getHost().isAuthorizationEnabled()) { return op.getAuthorizationContext().getClaims().getSu...
LuceneDocumentIndexService extends StatelessService { private String getSubject(Operation op) { if (op.getAuthorizationContext() != null && op.getAuthorizationContext().isSystemUser()) { return SystemUserService.SELF_LINK; } if (getHost().isAuthorizationEnabled()) { return op.getAuthorizationContext().getClaims().getSu...
LuceneDocumentIndexService extends StatelessService { private String getSubject(Operation op) { if (op.getAuthorizationContext() != null && op.getAuthorizationContext().isSystemUser()) { return SystemUserService.SELF_LINK; } if (getHost().isAuthorizationEnabled()) { return op.getAuthorizationContext().getClaims().getSu...
@Test public void testQueryDocumentWithBaseUri() throws Throwable { try { this.queryHelper.setBaseUri(null); fail("IllegalArgumentException expected with null base URI."); } catch (IllegalArgumentException e) { } this.minimalTestStates = queryDocumentWithBaseUri("testLink"); assertEquals(0, this.minimalTestStates.size(...
public QueryTaskClientHelper<T> setBaseUri(URI baseUri) { assertNotNull(baseUri, "'baseUri' must not be null."); this.baseUri = baseUri; return this; }
QueryTaskClientHelper { public QueryTaskClientHelper<T> setBaseUri(URI baseUri) { assertNotNull(baseUri, "'baseUri' must not be null."); this.baseUri = baseUri; return this; } }
QueryTaskClientHelper { public QueryTaskClientHelper<T> setBaseUri(URI baseUri) { assertNotNull(baseUri, "'baseUri' must not be null."); this.baseUri = baseUri; return this; } private QueryTaskClientHelper(Class<T> type); }
QueryTaskClientHelper { public QueryTaskClientHelper<T> setBaseUri(URI baseUri) { assertNotNull(baseUri, "'baseUri' must not be null."); this.baseUri = baseUri; return this; } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClientHelper<T> setDocumentLink(S...
QueryTaskClientHelper { public QueryTaskClientHelper<T> setBaseUri(URI baseUri) { assertNotNull(baseUri, "'baseUri' must not be null."); this.baseUri = baseUri; return this; } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClientHelper<T> setDocumentLink(S...
@Test public void testQueryDocumentWithFactoryPath() throws Throwable { try { this.queryHelper.setFactoryPath(null); fail("IllegalArgumentException expected with null factoryPath."); } catch (IllegalArgumentException e) { } this.minimalTestStates = queryDocumentWithFactoryPath("testLink"); assertEquals(0, this.minimalT...
public QueryTaskClientHelper<T> setFactoryPath(String factoryPath) { assertNotNull(factoryPath, "'factoryPath' must not be null."); this.factoryPath = factoryPath; return this; }
QueryTaskClientHelper { public QueryTaskClientHelper<T> setFactoryPath(String factoryPath) { assertNotNull(factoryPath, "'factoryPath' must not be null."); this.factoryPath = factoryPath; return this; } }
QueryTaskClientHelper { public QueryTaskClientHelper<T> setFactoryPath(String factoryPath) { assertNotNull(factoryPath, "'factoryPath' must not be null."); this.factoryPath = factoryPath; return this; } private QueryTaskClientHelper(Class<T> type); }
QueryTaskClientHelper { public QueryTaskClientHelper<T> setFactoryPath(String factoryPath) { assertNotNull(factoryPath, "'factoryPath' must not be null."); this.factoryPath = factoryPath; return this; } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClient...
QueryTaskClientHelper { public QueryTaskClientHelper<T> setFactoryPath(String factoryPath) { assertNotNull(factoryPath, "'factoryPath' must not be null."); this.factoryPath = factoryPath; return this; } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClient...
@Test public void testQueryUpdatedDocumentSince() throws Throwable { long futureDate = Utils.getNowMicrosUtc() + TimeUnit.DAYS.toMicros(1); try { this.queryHelper.setUpdatedSince(futureDate); fail("IllegalArgumentException expected when date in future."); } catch (IllegalArgumentException e) { } long startTime = Utils....
public QueryTaskClientHelper<T> setUpdatedSince(long documentSinceUpdateTimeMicros) { long nowMicrosUtc = Utils.getNowMicrosUtc(); if (nowMicrosUtc < documentSinceUpdateTimeMicros) { throw new IllegalArgumentException( "'documentSinceUpdateTimeMicros' must be in the past."); } Query query = Builder.create().addKindFiel...
QueryTaskClientHelper { public QueryTaskClientHelper<T> setUpdatedSince(long documentSinceUpdateTimeMicros) { long nowMicrosUtc = Utils.getNowMicrosUtc(); if (nowMicrosUtc < documentSinceUpdateTimeMicros) { throw new IllegalArgumentException( "'documentSinceUpdateTimeMicros' must be in the past."); } Query query = Buil...
QueryTaskClientHelper { public QueryTaskClientHelper<T> setUpdatedSince(long documentSinceUpdateTimeMicros) { long nowMicrosUtc = Utils.getNowMicrosUtc(); if (nowMicrosUtc < documentSinceUpdateTimeMicros) { throw new IllegalArgumentException( "'documentSinceUpdateTimeMicros' must be in the past."); } Query query = Buil...
QueryTaskClientHelper { public QueryTaskClientHelper<T> setUpdatedSince(long documentSinceUpdateTimeMicros) { long nowMicrosUtc = Utils.getNowMicrosUtc(); if (nowMicrosUtc < documentSinceUpdateTimeMicros) { throw new IllegalArgumentException( "'documentSinceUpdateTimeMicros' must be in the past."); } Query query = Buil...
QueryTaskClientHelper { public QueryTaskClientHelper<T> setUpdatedSince(long documentSinceUpdateTimeMicros) { long nowMicrosUtc = Utils.getNowMicrosUtc(); if (nowMicrosUtc < documentSinceUpdateTimeMicros) { throw new IllegalArgumentException( "'documentSinceUpdateTimeMicros' must be in the past."); } Query query = Buil...
@Test public void testQueryUpdatedSince() throws Throwable { long startTime = Utils.getNowMicrosUtc(); MinimalTestServiceState minimalTestState = new MinimalTestServiceState(); minimalTestState.id = this.idValue1; minimalTestState = doPost(minimalTestState); MinimalTestServiceState minimalTestState1 = new MinimalTestSe...
private static void assertNotNull(Object value, String propertyName) { if (value == null) { throw new IllegalArgumentException("'" + propertyName + "' is required"); } }
QueryTaskClientHelper { private static void assertNotNull(Object value, String propertyName) { if (value == null) { throw new IllegalArgumentException("'" + propertyName + "' is required"); } } }
QueryTaskClientHelper { private static void assertNotNull(Object value, String propertyName) { if (value == null) { throw new IllegalArgumentException("'" + propertyName + "' is required"); } } private QueryTaskClientHelper(Class<T> type); }
QueryTaskClientHelper { private static void assertNotNull(Object value, String propertyName) { if (value == null) { throw new IllegalArgumentException("'" + propertyName + "' is required"); } } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClientHelper<T>...
QueryTaskClientHelper { private static void assertNotNull(Object value, String propertyName) { if (value == null) { throw new IllegalArgumentException("'" + propertyName + "' is required"); } } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClientHelper<T>...
@Test public void testCountQuery() throws Throwable { int numberOfServices = 20; this.services = this.host.doThroughputServiceStart(numberOfServices, MinimalTestService.class, this.host.buildMinimalTestState(), EnumSet.of(ServiceOption.PERSISTENCE), null); Query query = Builder.create().addKindFieldClause(MinimalTestSe...
public static <T extends ServiceDocument> QueryTaskClientHelper<T> create(Class<T> type) { return new QueryTaskClientHelper<T>(type); }
QueryTaskClientHelper { public static <T extends ServiceDocument> QueryTaskClientHelper<T> create(Class<T> type) { return new QueryTaskClientHelper<T>(type); } }
QueryTaskClientHelper { public static <T extends ServiceDocument> QueryTaskClientHelper<T> create(Class<T> type) { return new QueryTaskClientHelper<T>(type); } private QueryTaskClientHelper(Class<T> type); }
QueryTaskClientHelper { public static <T extends ServiceDocument> QueryTaskClientHelper<T> create(Class<T> type) { return new QueryTaskClientHelper<T>(type); } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClientHelper<T> setDocumentLink(String documentSe...
QueryTaskClientHelper { public static <T extends ServiceDocument> QueryTaskClientHelper<T> create(Class<T> type) { return new QueryTaskClientHelper<T>(type); } private QueryTaskClientHelper(Class<T> type); static QueryTaskClientHelper<T> create(Class<T> type); QueryTaskClientHelper<T> setDocumentLink(String documentSe...
@Test public void normalizePath() throws Throwable { String nr = UriUtils.normalizeUriPath("/foo/"); assertEquals("/foo", nr); nr = UriUtils.normalizeUriPath("/foo"); assertEquals("/foo", nr); nr = UriUtils.normalizeUriPath(""); assertEquals("", nr); }
public static String normalizeUriPath(String path) { if (path == null) { return ""; } if (path.isEmpty()) { return path; } if (path.endsWith(URI_PATH_CHAR)) { path = path.substring(0, path.length() - 1); } if (path.startsWith(URI_PATH_CHAR)) { return path; } return URI_PATH_CHAR + path; }
UriUtils { public static String normalizeUriPath(String path) { if (path == null) { return ""; } if (path.isEmpty()) { return path; } if (path.endsWith(URI_PATH_CHAR)) { path = path.substring(0, path.length() - 1); } if (path.startsWith(URI_PATH_CHAR)) { return path; } return URI_PATH_CHAR + path; } }
UriUtils { public static String normalizeUriPath(String path) { if (path == null) { return ""; } if (path.isEmpty()) { return path; } if (path.endsWith(URI_PATH_CHAR)) { path = path.substring(0, path.length() - 1); } if (path.startsWith(URI_PATH_CHAR)) { return path; } return URI_PATH_CHAR + path; } private UriUtils()...
UriUtils { public static String normalizeUriPath(String path) { if (path == null) { return ""; } if (path.isEmpty()) { return path; } if (path.endsWith(URI_PATH_CHAR)) { path = path.substring(0, path.length() - 1); } if (path.startsWith(URI_PATH_CHAR)) { return path; } return URI_PATH_CHAR + path; } private UriUtils()...
UriUtils { public static String normalizeUriPath(String path) { if (path == null) { return ""; } if (path.isEmpty()) { return path; } if (path.endsWith(URI_PATH_CHAR)) { path = path.substring(0, path.length() - 1); } if (path.startsWith(URI_PATH_CHAR)) { return path; } return URI_PATH_CHAR + path; } private UriUtils()...
@Test public void updateUriPort() { int port = 8000; int newPort = 10000; URI original = UriUtils.buildUri("http: assertEquals(null, UriUtils.updateUriPort(null, 0)); assertEquals(original.getPort(), UriUtils.updateUriPort(original, port).getPort()); URI newUri = UriUtils.updateUriPort(original, newPort); assertEquals(...
public static URI updateUriPort(URI uri, int newPort) { if (uri == null) { return null; } if (uri.getPort() == newPort) { return uri; } return UriUtils.buildUri(uri.getScheme(), uri.getHost(), newPort, uri.getPath(), uri.getQuery()); }
UriUtils { public static URI updateUriPort(URI uri, int newPort) { if (uri == null) { return null; } if (uri.getPort() == newPort) { return uri; } return UriUtils.buildUri(uri.getScheme(), uri.getHost(), newPort, uri.getPath(), uri.getQuery()); } }
UriUtils { public static URI updateUriPort(URI uri, int newPort) { if (uri == null) { return null; } if (uri.getPort() == newPort) { return uri; } return UriUtils.buildUri(uri.getScheme(), uri.getHost(), newPort, uri.getPath(), uri.getQuery()); } private UriUtils(); }
UriUtils { public static URI updateUriPort(URI uri, int newPort) { if (uri == null) { return null; } if (uri.getPort() == newPort) { return uri; } return UriUtils.buildUri(uri.getScheme(), uri.getHost(), newPort, uri.getPath(), uri.getQuery()); } private UriUtils(); static String getParentPath(String path); static boo...
UriUtils { public static URI updateUriPort(URI uri, int newPort) { if (uri == null) { return null; } if (uri.getPort() == newPort) { return uri; } return UriUtils.buildUri(uri.getScheme(), uri.getHost(), newPort, uri.getPath(), uri.getQuery()); } private UriUtils(); static String getParentPath(String path); static boo...
@Test public void extendQueryPageLinkWithQuery() throws Throwable { final String basicPageLink = "/core/query-page/1469733619696001"; URI u = new URI("http: URI forwarderUri = UriUtils.buildForwardToPeerUri(u, UUID.randomUUID().toString(), ServiceUriPaths.DEFAULT_NODE_SELECTOR, EnumSet.noneOf(ServiceOption.class)); Str...
public static String extendQueryPageLinkWithQuery(String pageLink, String queryKeyValues) { final String querySegmentPrefix = UriUtils.URI_QUERY_PARAM_LINK_CHAR + UriUtils.FORWARDING_URI_PARAM_NAME_QUERY + UriUtils.URI_QUERY_PARAM_KV_CHAR; int querySegmentIndex = pageLink.indexOf(querySegmentPrefix); if (queryKeyValues...
UriUtils { public static String extendQueryPageLinkWithQuery(String pageLink, String queryKeyValues) { final String querySegmentPrefix = UriUtils.URI_QUERY_PARAM_LINK_CHAR + UriUtils.FORWARDING_URI_PARAM_NAME_QUERY + UriUtils.URI_QUERY_PARAM_KV_CHAR; int querySegmentIndex = pageLink.indexOf(querySegmentPrefix); if (que...
UriUtils { public static String extendQueryPageLinkWithQuery(String pageLink, String queryKeyValues) { final String querySegmentPrefix = UriUtils.URI_QUERY_PARAM_LINK_CHAR + UriUtils.FORWARDING_URI_PARAM_NAME_QUERY + UriUtils.URI_QUERY_PARAM_KV_CHAR; int querySegmentIndex = pageLink.indexOf(querySegmentPrefix); if (que...
UriUtils { public static String extendQueryPageLinkWithQuery(String pageLink, String queryKeyValues) { final String querySegmentPrefix = UriUtils.URI_QUERY_PARAM_LINK_CHAR + UriUtils.FORWARDING_URI_PARAM_NAME_QUERY + UriUtils.URI_QUERY_PARAM_KV_CHAR; int querySegmentIndex = pageLink.indexOf(querySegmentPrefix); if (que...
UriUtils { public static String extendQueryPageLinkWithQuery(String pageLink, String queryKeyValues) { final String querySegmentPrefix = UriUtils.URI_QUERY_PARAM_LINK_CHAR + UriUtils.FORWARDING_URI_PARAM_NAME_QUERY + UriUtils.URI_QUERY_PARAM_KV_CHAR; int querySegmentIndex = pageLink.indexOf(querySegmentPrefix); if (que...
@Test public void buildSafeUri() { String input = "</script>"; try { new URI(input); } catch (URISyntaxException e) { assertTrue(e.getInput().contains("</script>")); } try { UriUtils.buildSafeUri(input); } catch (URISyntaxException e) { assertTrue(e.getInput().contains("%3C%2Fscript%3E")); } }
public static URI buildSafeUri(String scheme, String userInfo, String host, int port, String path, String query, String fragment) throws URISyntaxException { try { return new URI(scheme, userInfo, host, port, path, query, fragment); } catch (URISyntaxException e) { String encodedInput = URLEncode(e.getInput()); throw n...
UriUtils { public static URI buildSafeUri(String scheme, String userInfo, String host, int port, String path, String query, String fragment) throws URISyntaxException { try { return new URI(scheme, userInfo, host, port, path, query, fragment); } catch (URISyntaxException e) { String encodedInput = URLEncode(e.getInput(...
UriUtils { public static URI buildSafeUri(String scheme, String userInfo, String host, int port, String path, String query, String fragment) throws URISyntaxException { try { return new URI(scheme, userInfo, host, port, path, query, fragment); } catch (URISyntaxException e) { String encodedInput = URLEncode(e.getInput(...
UriUtils { public static URI buildSafeUri(String scheme, String userInfo, String host, int port, String path, String query, String fragment) throws URISyntaxException { try { return new URI(scheme, userInfo, host, port, path, query, fragment); } catch (URISyntaxException e) { String encodedInput = URLEncode(e.getInput(...
UriUtils { public static URI buildSafeUri(String scheme, String userInfo, String host, int port, String path, String query, String fragment) throws URISyntaxException { try { return new URI(scheme, userInfo, host, port, path, query, fragment); } catch (URISyntaxException e) { String encodedInput = URLEncode(e.getInput(...
@Test public void extendUriWithQuery() throws URISyntaxException { String query = "key1=value1&key2=value2"; String basePath = UriUtils.buildUriPath("some", UUID.randomUUID().toString()); URI baseUri = new URI("http: URI baseHttpsUri = new URI("https: URI httpBase = UriUtils.buildUri(baseUri, basePath); URI httpsBase =...
public static URI extendUriWithQuery(URI u, String... keyValues) { String query = u.getQuery(); if (query != null && !query.isEmpty()) { query += URI_QUERY_PARAM_LINK_CHAR_CONST + buildUriQuery(keyValues); } else { query = buildUriQuery(keyValues); } try { return new URI(u.getScheme(), null, u.getHost(), u.getPort(), u...
UriUtils { public static URI extendUriWithQuery(URI u, String... keyValues) { String query = u.getQuery(); if (query != null && !query.isEmpty()) { query += URI_QUERY_PARAM_LINK_CHAR_CONST + buildUriQuery(keyValues); } else { query = buildUriQuery(keyValues); } try { return new URI(u.getScheme(), null, u.getHost(), u.g...
UriUtils { public static URI extendUriWithQuery(URI u, String... keyValues) { String query = u.getQuery(); if (query != null && !query.isEmpty()) { query += URI_QUERY_PARAM_LINK_CHAR_CONST + buildUriQuery(keyValues); } else { query = buildUriQuery(keyValues); } try { return new URI(u.getScheme(), null, u.getHost(), u.g...
UriUtils { public static URI extendUriWithQuery(URI u, String... keyValues) { String query = u.getQuery(); if (query != null && !query.isEmpty()) { query += URI_QUERY_PARAM_LINK_CHAR_CONST + buildUriQuery(keyValues); } else { query = buildUriQuery(keyValues); } try { return new URI(u.getScheme(), null, u.getHost(), u.g...
UriUtils { public static URI extendUriWithQuery(URI u, String... keyValues) { String query = u.getQuery(); if (query != null && !query.isEmpty()) { query += URI_QUERY_PARAM_LINK_CHAR_CONST + buildUriQuery(keyValues); } else { query = buildUriQuery(keyValues); } try { return new URI(u.getScheme(), null, u.getHost(), u.g...
@Test public void putWithFailureAndCacheValidation() throws Throwable { setUpHost(false); List<Service> services = this.host.doThroughputServiceStart( 1, MinimalTestService.class, this.host.buildMinimalTestState(), EnumSet.of(Service.ServiceOption.PERSISTENCE), null); URI uri = services.get(0).getUri(); MinimalTestServ...
@Override public URI getUri() { return this.uri; }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
@Test public void buildUri() throws URISyntaxException { URI baseUri = new URI("http: URI baseHttpsUri = new URI("https: String pathSegment = UUID.randomUUID().toString(); String pathSegment2 = UUID.randomUUID().toString(); URI u = UriUtils.buildUri(baseUri, pathSegment); assertEquals("http", u.getScheme()); assertEqua...
public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, ...
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, ...
@Test public void buildUriFromParts() throws URISyntaxException { String scheme = "http"; String host = "host"; int port = 8080; String path = "path/to/somewhere"; String query = "key1=value1&key2=value2"; URI u = UriUtils.buildUri(scheme, host, port, path, query); assertEquals(scheme, u.getScheme()); assertEquals(host...
public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, ...
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, ...
@Test public void extendUri() throws URISyntaxException { String basePath = UriUtils.buildUriPath("some", UUID.randomUUID().toString()); URI baseUri = new URI("http: URI baseHttpsUri = new URI("https: URI httpBase = UriUtils.buildUri(baseUri, basePath); URI httpsBase = UriUtils.buildUri(baseHttpsUri, basePath); String ...
public static URI extendUri(URI uri, String path) { String query = null; if (path != null) { final int indexOfFirstQueryChar = path.indexOf(URI_QUERY_CHAR_CONST); if (indexOfFirstQueryChar >= 0) { if (indexOfFirstQueryChar < path.length() - 1) { query = path.substring(indexOfFirstQueryChar + 1); } path = path.substring...
UriUtils { public static URI extendUri(URI uri, String path) { String query = null; if (path != null) { final int indexOfFirstQueryChar = path.indexOf(URI_QUERY_CHAR_CONST); if (indexOfFirstQueryChar >= 0) { if (indexOfFirstQueryChar < path.length() - 1) { query = path.substring(indexOfFirstQueryChar + 1); } path = pat...
UriUtils { public static URI extendUri(URI uri, String path) { String query = null; if (path != null) { final int indexOfFirstQueryChar = path.indexOf(URI_QUERY_CHAR_CONST); if (indexOfFirstQueryChar >= 0) { if (indexOfFirstQueryChar < path.length() - 1) { query = path.substring(indexOfFirstQueryChar + 1); } path = pat...
UriUtils { public static URI extendUri(URI uri, String path) { String query = null; if (path != null) { final int indexOfFirstQueryChar = path.indexOf(URI_QUERY_CHAR_CONST); if (indexOfFirstQueryChar >= 0) { if (indexOfFirstQueryChar < path.length() - 1) { query = path.substring(indexOfFirstQueryChar + 1); } path = pat...
UriUtils { public static URI extendUri(URI uri, String path) { String query = null; if (path != null) { final int indexOfFirstQueryChar = path.indexOf(URI_QUERY_CHAR_CONST); if (indexOfFirstQueryChar >= 0) { if (indexOfFirstQueryChar < path.length() - 1) { query = path.substring(indexOfFirstQueryChar + 1); } path = pat...
@Test public void getParentPath() { assertEquals("/a/b", UriUtils.getParentPath("/a/b/c")); assertEquals("/a", UriUtils.getParentPath("/a/b")); assertEquals("/", UriUtils.getParentPath("/a")); assertEquals(null, UriUtils.getParentPath("/")); }
public static String getParentPath(String path) { int parentPathIndex = path.lastIndexOf(URI_PATH_CHAR_CONST); if (parentPathIndex > 0) { return path.substring(0, parentPathIndex); } if (parentPathIndex == 0 && path.length() > 1) { return URI_PATH_CHAR; } return null; }
UriUtils { public static String getParentPath(String path) { int parentPathIndex = path.lastIndexOf(URI_PATH_CHAR_CONST); if (parentPathIndex > 0) { return path.substring(0, parentPathIndex); } if (parentPathIndex == 0 && path.length() > 1) { return URI_PATH_CHAR; } return null; } }
UriUtils { public static String getParentPath(String path) { int parentPathIndex = path.lastIndexOf(URI_PATH_CHAR_CONST); if (parentPathIndex > 0) { return path.substring(0, parentPathIndex); } if (parentPathIndex == 0 && path.length() > 1) { return URI_PATH_CHAR; } return null; } private UriUtils(); }
UriUtils { public static String getParentPath(String path) { int parentPathIndex = path.lastIndexOf(URI_PATH_CHAR_CONST); if (parentPathIndex > 0) { return path.substring(0, parentPathIndex); } if (parentPathIndex == 0 && path.length() > 1) { return URI_PATH_CHAR; } return null; } private UriUtils(); static String get...
UriUtils { public static String getParentPath(String path) { int parentPathIndex = path.lastIndexOf(URI_PATH_CHAR_CONST); if (parentPathIndex > 0) { return path.substring(0, parentPathIndex); } if (parentPathIndex == 0 && path.length() > 1) { return URI_PATH_CHAR; } return null; } private UriUtils(); static String get...
@Test public void buildUriFromString() throws Throwable { assertEquals(null, UriUtils.buildUri("http: assertEquals(new URI(""), UriUtils.buildUri("")); assertEquals(new URI("http: UriUtils.buildUri("http: assertEquals(new URI("/one/two/three"), UriUtils.buildUri("/one/two/three")); }
public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); }
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, ...
UriUtils { public static URI buildUri(String host, int port, String path, String query) { return buildUri(HTTP_SCHEME, host, port, path, query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, ...
@Test public void testConvertUriPathCharsFromLink() { assertEquals("core-examples", UriUtils.convertPathCharsFromLink(" assertEquals("core-examples", UriUtils.convertPathCharsFromLink(" assertEquals("core-local-query-tasks", UriUtils.convertPathCharsFromLink(" assertEquals(null, UriUtils.convertPathCharsFromLink("@*#(@...
public static String convertPathCharsFromLink(String path) { try { String uriPath = (new URI(path)).getPath(); return trimPathSlashes(uriPath).replace(URI_PATH_CHAR_CONST, '-'); } catch (URISyntaxException ex) { return null; } }
UriUtils { public static String convertPathCharsFromLink(String path) { try { String uriPath = (new URI(path)).getPath(); return trimPathSlashes(uriPath).replace(URI_PATH_CHAR_CONST, '-'); } catch (URISyntaxException ex) { return null; } } }
UriUtils { public static String convertPathCharsFromLink(String path) { try { String uriPath = (new URI(path)).getPath(); return trimPathSlashes(uriPath).replace(URI_PATH_CHAR_CONST, '-'); } catch (URISyntaxException ex) { return null; } } private UriUtils(); }
UriUtils { public static String convertPathCharsFromLink(String path) { try { String uriPath = (new URI(path)).getPath(); return trimPathSlashes(uriPath).replace(URI_PATH_CHAR_CONST, '-'); } catch (URISyntaxException ex) { return null; } } private UriUtils(); static String getParentPath(String path); static boolean is...
UriUtils { public static String convertPathCharsFromLink(String path) { try { String uriPath = (new URI(path)).getPath(); return trimPathSlashes(uriPath).replace(URI_PATH_CHAR_CONST, '-'); } catch (URISyntaxException ex) { return null; } } private UriUtils(); static String getParentPath(String path); static boolean is...
@Test public void testTrimPathSlashes() { assertEquals("a", UriUtils.trimPathSlashes(" assertEquals("a", UriUtils.trimPathSlashes(" assertEquals("a", UriUtils.trimPathSlashes("a assertEquals("a", UriUtils.trimPathSlashes("/a/")); assertEquals("a", UriUtils.trimPathSlashes("a")); assertEquals("a/b", UriUtils.trimPathSla...
public static String trimPathSlashes(String path) { return TRIM_PATH_SLASHES_PATTERN.matcher(path).replaceAll(""); }
UriUtils { public static String trimPathSlashes(String path) { return TRIM_PATH_SLASHES_PATTERN.matcher(path).replaceAll(""); } }
UriUtils { public static String trimPathSlashes(String path) { return TRIM_PATH_SLASHES_PATTERN.matcher(path).replaceAll(""); } private UriUtils(); }
UriUtils { public static String trimPathSlashes(String path) { return TRIM_PATH_SLASHES_PATTERN.matcher(path).replaceAll(""); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, String path); stati...
UriUtils { public static String trimPathSlashes(String path) { return TRIM_PATH_SLASHES_PATTERN.matcher(path).replaceAll(""); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, String path); stati...
@Test public void isChildPath() { assertFalse(UriUtils.isChildPath(null, "/a/b")); assertFalse(UriUtils.isChildPath("/a/b/c", null)); assertTrue(UriUtils.isChildPath("/a/b/c", "/a/b")); assertTrue(UriUtils.isChildPath("/a/b/c", "/a/b/")); assertFalse(UriUtils.isChildPath("/a/bb/c", "/a/b")); assertTrue(UriUtils.isChild...
public static boolean isChildPath(String path, String parentPath) { if (parentPath == null || path == null) { return false; } if (!path.startsWith(parentPath)) { return false; } if (!parentPath.endsWith(URI_PATH_CHAR) && !path.startsWith(URI_PATH_CHAR, parentPath.length())) { return false; } return true; }
UriUtils { public static boolean isChildPath(String path, String parentPath) { if (parentPath == null || path == null) { return false; } if (!path.startsWith(parentPath)) { return false; } if (!parentPath.endsWith(URI_PATH_CHAR) && !path.startsWith(URI_PATH_CHAR, parentPath.length())) { return false; } return true; } }
UriUtils { public static boolean isChildPath(String path, String parentPath) { if (parentPath == null || path == null) { return false; } if (!path.startsWith(parentPath)) { return false; } if (!parentPath.endsWith(URI_PATH_CHAR) && !path.startsWith(URI_PATH_CHAR, parentPath.length())) { return false; } return true; } p...
UriUtils { public static boolean isChildPath(String path, String parentPath) { if (parentPath == null || path == null) { return false; } if (!path.startsWith(parentPath)) { return false; } if (!parentPath.endsWith(URI_PATH_CHAR) && !path.startsWith(URI_PATH_CHAR, parentPath.length())) { return false; } return true; } p...
UriUtils { public static boolean isChildPath(String path, String parentPath) { if (parentPath == null || path == null) { return false; } if (!path.startsWith(parentPath)) { return false; } if (!parentPath.endsWith(URI_PATH_CHAR) && !path.startsWith(URI_PATH_CHAR, parentPath.length())) { return false; } return true; } p...
@Test public void getLastPathSegment() { assertEquals("example", UriUtils.getLastPathSegment(UriUtils.buildUri("http: assertEquals("example", UriUtils.getLastPathSegment(UriUtils.buildUri("http: assertEquals("", UriUtils.getLastPathSegment(UriUtils.buildUri("http: assertEquals("", UriUtils.getLastPathSegment(UriUtils.b...
public static String getLastPathSegment(URI uri) { String path = uri.getPath(); return getLastPathSegment(path); }
UriUtils { public static String getLastPathSegment(URI uri) { String path = uri.getPath(); return getLastPathSegment(path); } }
UriUtils { public static String getLastPathSegment(URI uri) { String path = uri.getPath(); return getLastPathSegment(path); } private UriUtils(); }
UriUtils { public static String getLastPathSegment(URI uri) { String path = uri.getPath(); return getLastPathSegment(path); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, String path); static ...
UriUtils { public static String getLastPathSegment(URI uri) { String path = uri.getPath(); return getLastPathSegment(path); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, String path); static ...
@Test public void hasODataExpandParamValue() { URI u = UriUtils.buildUri("http: assertTrue(UriUtils.hasODataExpandParamValue(u)); u = UriUtils.buildUri("http: assertTrue(UriUtils.hasODataExpandParamValue(u)); u = UriUtils.buildUri("http: assertFalse(UriUtils.hasODataExpandParamValue(u)); u = UriUtils.buildUri("http: as...
public static boolean hasODataExpandParamValue(URI uri) { String query = uri.getQuery(); if (query == null || query.isEmpty()) { return false; } return query.contains(UriUtils.URI_PARAM_ODATA_EXPAND) || query.contains(UriUtils.URI_PARAM_ODATA_EXPAND_NO_DOLLAR_SIGN); }
UriUtils { public static boolean hasODataExpandParamValue(URI uri) { String query = uri.getQuery(); if (query == null || query.isEmpty()) { return false; } return query.contains(UriUtils.URI_PARAM_ODATA_EXPAND) || query.contains(UriUtils.URI_PARAM_ODATA_EXPAND_NO_DOLLAR_SIGN); } }
UriUtils { public static boolean hasODataExpandParamValue(URI uri) { String query = uri.getQuery(); if (query == null || query.isEmpty()) { return false; } return query.contains(UriUtils.URI_PARAM_ODATA_EXPAND) || query.contains(UriUtils.URI_PARAM_ODATA_EXPAND_NO_DOLLAR_SIGN); } private UriUtils(); }
UriUtils { public static boolean hasODataExpandParamValue(URI uri) { String query = uri.getQuery(); if (query == null || query.isEmpty()) { return false; } return query.contains(UriUtils.URI_PARAM_ODATA_EXPAND) || query.contains(UriUtils.URI_PARAM_ODATA_EXPAND_NO_DOLLAR_SIGN); } private UriUtils(); static String getPa...
UriUtils { public static boolean hasODataExpandParamValue(URI uri) { String query = uri.getQuery(); if (query == null || query.isEmpty()) { return false; } return query.contains(UriUtils.URI_PARAM_ODATA_EXPAND) || query.contains(UriUtils.URI_PARAM_ODATA_EXPAND_NO_DOLLAR_SIGN); } private UriUtils(); static String getPa...
@Test public void commitNotification() throws Throwable { setUpHost(false); this.host.stop(); this.host.setPort(0); this.host.start(); this.host.waitForServiceAvailable(ExampleService.FACTORY_LINK); AtomicBoolean isNotified = new AtomicBoolean(false); AtomicLong sequenceNumber = new AtomicLong(); Operation subscribe = ...
@Override public URI getUri() { return this.uri; }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
@Test public void testParseUriQueryParams() { URI u = UriUtils.buildUri("http: Map<String, String> queryParams = UriUtils.parseUriQueryParams(u); assertEquals(5, queryParams.size()); assertTrue(queryParams.get("a").equals("b")); assertTrue(queryParams.get("c").equals("d")); assertTrue(queryParams.get("d").equals("")); ...
public static Map<String, String> parseUriQueryParams(URI uri) { String query = uri.getQuery(); return parseUriQueryParams(query); }
UriUtils { public static Map<String, String> parseUriQueryParams(URI uri) { String query = uri.getQuery(); return parseUriQueryParams(query); } }
UriUtils { public static Map<String, String> parseUriQueryParams(URI uri) { String query = uri.getQuery(); return parseUriQueryParams(query); } private UriUtils(); }
UriUtils { public static Map<String, String> parseUriQueryParams(URI uri) { String query = uri.getQuery(); return parseUriQueryParams(query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, Str...
UriUtils { public static Map<String, String> parseUriQueryParams(URI uri) { String query = uri.getQuery(); return parseUriQueryParams(query); } private UriUtils(); static String getParentPath(String path); static boolean isChildPath(String path, String parentPath); static URI buildSubscriptionUri(ServiceHost host, Str...
@Test public void buildDocumentQueryUri() throws Throwable { ServiceHost host = ServiceHost.create(); URI uri = UriUtils.buildDocumentQueryUri(host, "/my-index-service", "my-service", false, false, EnumSet.of(ServiceOption.NONE)); assertEquals("/my-index-service", uri.getPath()); }
public static URI buildDocumentQueryUri(ServiceHost host, String selfLink, boolean doExpand, boolean includeDeleted, EnumSet<ServiceOption> serviceCaps) { String indexServicePath = host.getDocumentIndexServiceUri().getPath(); return buildDocumentQueryUri(host, indexServicePath, selfLink, doExpand, includeDeleted, servi...
UriUtils { public static URI buildDocumentQueryUri(ServiceHost host, String selfLink, boolean doExpand, boolean includeDeleted, EnumSet<ServiceOption> serviceCaps) { String indexServicePath = host.getDocumentIndexServiceUri().getPath(); return buildDocumentQueryUri(host, indexServicePath, selfLink, doExpand, includeDel...
UriUtils { public static URI buildDocumentQueryUri(ServiceHost host, String selfLink, boolean doExpand, boolean includeDeleted, EnumSet<ServiceOption> serviceCaps) { String indexServicePath = host.getDocumentIndexServiceUri().getPath(); return buildDocumentQueryUri(host, indexServicePath, selfLink, doExpand, includeDel...
UriUtils { public static URI buildDocumentQueryUri(ServiceHost host, String selfLink, boolean doExpand, boolean includeDeleted, EnumSet<ServiceOption> serviceCaps) { String indexServicePath = host.getDocumentIndexServiceUri().getPath(); return buildDocumentQueryUri(host, indexServicePath, selfLink, doExpand, includeDel...
UriUtils { public static URI buildDocumentQueryUri(ServiceHost host, String selfLink, boolean doExpand, boolean includeDeleted, EnumSet<ServiceOption> serviceCaps) { String indexServicePath = host.getDocumentIndexServiceUri().getPath(); return buildDocumentQueryUri(host, indexServicePath, selfLink, doExpand, includeDel...
@Test public void cacheUpdateAfterSynchronization() throws Throwable { setUpMultiNode(); for (VerificationHost host : this.host.getInProcessHostMap().values()) { host.setServiceCacheClearDelayMicros(TimeUnit.MINUTES.toMicros(3)); } this.host.setNodeGroupQuorum(this.nodeCount - 1); this.host.waitForNodeGroupConvergence(...
public static SynchronizationTaskService create(Supplier<Service> childServiceInstantiator) { if (childServiceInstantiator.get() == null) { throw new IllegalArgumentException( "childServiceInstantiator created null child service"); } SynchronizationTaskService taskService = new SynchronizationTaskService(); taskService...
SynchronizationTaskService extends TaskService<SynchronizationTaskService.State> { public static SynchronizationTaskService create(Supplier<Service> childServiceInstantiator) { if (childServiceInstantiator.get() == null) { throw new IllegalArgumentException( "childServiceInstantiator created null child service"); } Syn...
SynchronizationTaskService extends TaskService<SynchronizationTaskService.State> { public static SynchronizationTaskService create(Supplier<Service> childServiceInstantiator) { if (childServiceInstantiator.get() == null) { throw new IllegalArgumentException( "childServiceInstantiator created null child service"); } Syn...
SynchronizationTaskService extends TaskService<SynchronizationTaskService.State> { public static SynchronizationTaskService create(Supplier<Service> childServiceInstantiator) { if (childServiceInstantiator.get() == null) { throw new IllegalArgumentException( "childServiceInstantiator created null child service"); } Syn...
SynchronizationTaskService extends TaskService<SynchronizationTaskService.State> { public static SynchronizationTaskService create(Supplier<Service> childServiceInstantiator) { if (childServiceInstantiator.get() == null) { throw new IllegalArgumentException( "childServiceInstantiator created null child service"); } Syn...
@Test public void getStats() throws Throwable { StatelessService service = new StatelessTestService(); service.setMaintenanceIntervalMicros(1000); service.options.add(Service.ServiceOption.INSTRUMENTATION); service.options.add(Service.ServiceOption.PERIODIC_MAINTENANCE); this.host.startServiceAndWait(service, "some/ser...
@Override public ServiceStats getStats() { Service s = this.getUtilityService(ServiceHost.SERVICE_URI_SUFFIX_STATS, false); if (s == null) { return null; } return s.getStats(); }
StatelessService implements Service { @Override public ServiceStats getStats() { Service s = this.getUtilityService(ServiceHost.SERVICE_URI_SUFFIX_STATS, false); if (s == null) { return null; } return s.getStats(); } }
StatelessService implements Service { @Override public ServiceStats getStats() { Service s = this.getUtilityService(ServiceHost.SERVICE_URI_SUFFIX_STATS, false); if (s == null) { return null; } return s.getStats(); } StatelessService(Class<? extends ServiceDocument> stateType); StatelessService(); }
StatelessService implements Service { @Override public ServiceStats getStats() { Service s = this.getUtilityService(ServiceHost.SERVICE_URI_SUFFIX_STATS, false); if (s == null) { return null; } return s.getStats(); } StatelessService(Class<? extends ServiceDocument> stateType); StatelessService(); @Override void handl...
StatelessService implements Service { @Override public ServiceStats getStats() { Service s = this.getUtilityService(ServiceHost.SERVICE_URI_SUFFIX_STATS, false); if (s == null) { return null; } return s.getStats(); } StatelessService(Class<? extends ServiceDocument> stateType); StatelessService(); @Override void handl...
@Test public void testDocumentMetadataIndexing() throws Throwable { LuceneDocumentIndexService.setMetadataUpdateMaxQueueDepth((int) this.serviceCount / 2); try { doDocumentMetadataIndexing(); } finally { LuceneDocumentIndexService.setMetadataUpdateMaxQueueDepth( LuceneDocumentIndexService.DEFAULT_METADATA_UPDATE_MAX_QU...
public static void setMetadataUpdateMaxQueueDepth(int depth) { metadataUpdateMaxQueueDepth = depth; }
LuceneDocumentIndexService extends StatelessService { public static void setMetadataUpdateMaxQueueDepth(int depth) { metadataUpdateMaxQueueDepth = depth; } }
LuceneDocumentIndexService extends StatelessService { public static void setMetadataUpdateMaxQueueDepth(int depth) { metadataUpdateMaxQueueDepth = depth; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); }
LuceneDocumentIndexService extends StatelessService { public static void setMetadataUpdateMaxQueueDepth(int depth) { metadataUpdateMaxQueueDepth = depth; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryRes...
LuceneDocumentIndexService extends StatelessService { public static void setMetadataUpdateMaxQueueDepth(int depth) { metadataUpdateMaxQueueDepth = depth; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryRes...
@Test public void recognizeSelfInPeerNodesByPublicUri() throws Throwable { String id = "node-" + VerificationHost.hostNumber.incrementAndGet(); String publicUri = "http: ExampleServiceHost nodeA = new ExampleServiceHost() { @Override public List<URI> getInitialPeerHosts() { try { Field field = ServiceHost.class.getDecl...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
@Test public void testMultiNodeNonReplicatedExpiration() throws Throwable { setUp(this.nodeCount); this.host.joinNodesAndVerifyConvergence(this.host.getPeerCount()); this.host.setNodeGroupQuorum(this.nodeCount); this.host.waitForNodeGroupConvergence(this.nodeCount); this.replicationTargetFactoryLink = NonPersistedExamp...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
@Test public void nodeRestartWithSameAddressDifferentId() throws Throwable { int failedNodeCount = 1; int afterFailureQuorum = this.nodeCount - failedNodeCount; setUp(this.nodeCount); setOperationTimeoutMicros(TimeUnit.SECONDS.toMicros(5)); this.host.joinNodesAndVerifyConvergence(this.nodeCount); this.host.log("Stoppin...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
@Test public void registerKind() { String kindBefore = Utils.buildKind(ExampleServiceState.class); String newKind = "e"; Utils.registerKind(ExampleServiceState.class, newKind); String kindAfter = Utils.buildKind(ExampleServiceState.class); assertEquals(newKind, kindAfter); Utils.registerKind(ExampleServiceState.class, ...
public static String registerKind(Class<?> type, String kind) { KIND_TO_TYPE.put(kind, type); return KINDS.put(type.getName(), kind); }
Utils { public static String registerKind(Class<?> type, String kind) { KIND_TO_TYPE.put(kind, type); return KINDS.put(type.getName(), kind); } }
Utils { public static String registerKind(Class<?> type, String kind) { KIND_TO_TYPE.put(kind, type); return KINDS.put(type.getName(), kind); } private Utils(); }
Utils { public static String registerKind(Class<?> type, String kind) { KIND_TO_TYPE.put(kind, type); return KINDS.put(type.getName(), kind); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLoca...
Utils { public static String registerKind(Class<?> type, String kind) { KIND_TO_TYPE.put(kind, type); return KINDS.put(type.getName(), kind); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLoca...
@Test public void buildUUID() { CommandLineArgumentParser.parseFromProperties(this); Utils.setTimeDriftThreshold(TimeUnit.HOURS.toMicros(1)); try { Logger log = Logger.getAnonymousLogger(); String baseId = Utils.computeHash("some id"); Set<String> set = new ConcurrentSkipListSet<>(); int threadCount = Utils.DEFAULT_THR...
public static String buildUUID(String id) { long timeMicros = 0; try { timeMicros = Utils.getNowMicrosUtc(); } catch (Throwable e) { timeMicros = Utils.getSystemNowMicrosUtc(); } return Utils.getBuilder() .append(id) .append(Long.toHexString(timeMicros)) .toString(); }
Utils { public static String buildUUID(String id) { long timeMicros = 0; try { timeMicros = Utils.getNowMicrosUtc(); } catch (Throwable e) { timeMicros = Utils.getSystemNowMicrosUtc(); } return Utils.getBuilder() .append(id) .append(Long.toHexString(timeMicros)) .toString(); } }
Utils { public static String buildUUID(String id) { long timeMicros = 0; try { timeMicros = Utils.getNowMicrosUtc(); } catch (Throwable e) { timeMicros = Utils.getSystemNowMicrosUtc(); } return Utils.getBuilder() .append(id) .append(Long.toHexString(timeMicros)) .toString(); } private Utils(); }
Utils { public static String buildUUID(String id) { long timeMicros = 0; try { timeMicros = Utils.getNowMicrosUtc(); } catch (Throwable e) { timeMicros = Utils.getSystemNowMicrosUtc(); } return Utils.getBuilder() .append(id) .append(Long.toHexString(timeMicros)) .toString(); } private Utils(); static void registerCust...
Utils { public static String buildUUID(String id) { long timeMicros = 0; try { timeMicros = Utils.getNowMicrosUtc(); } catch (Throwable e) { timeMicros = Utils.getSystemNowMicrosUtc(); } return Utils.getBuilder() .append(id) .append(Long.toHexString(timeMicros)) .toString(); } private Utils(); static void registerCust...
@Test public void computeByteHash() throws UnsupportedEncodingException { CommandLineArgumentParser.parseFromProperties(this); Set<String> keys = new HashSet<>(this.iterationCount); Set<Long> hashedKeys = new HashSet<>(this.iterationCount); long collisionCount = 0; for (int i = 0; i < this.iterationCount; i++) { String...
public static String computeHash(CharSequence content) { return Long.toHexString(FNVHash.compute(content)); }
Utils { public static String computeHash(CharSequence content) { return Long.toHexString(FNVHash.compute(content)); } }
Utils { public static String computeHash(CharSequence content) { return Long.toHexString(FNVHash.compute(content)); } private Utils(); }
Utils { public static String computeHash(CharSequence content) { return Long.toHexString(FNVHash.compute(content)); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isD...
Utils { public static String computeHash(CharSequence content) { return Long.toHexString(FNVHash.compute(content)); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isD...
@Test public void buildKind() { CommandLineArgumentParser.parseFromProperties(this); String kind = Utils.buildKind(ExampleServiceState.class); long s = System.nanoTime() / 1000; for (int i = 0; i < this.iterationCount; i++) { String k = Utils.buildKind(ExampleServiceState.class); assertTrue(kind.hashCode() == k.hashCod...
public static String buildKind(Class<?> type) { return KINDS.computeIfAbsent(type.getName(), name -> toDocumentKind(type)); }
Utils { public static String buildKind(Class<?> type) { return KINDS.computeIfAbsent(type.getName(), name -> toDocumentKind(type)); } }
Utils { public static String buildKind(Class<?> type) { return KINDS.computeIfAbsent(type.getName(), name -> toDocumentKind(type)); } private Utils(); }
Utils { public static String buildKind(Class<?> type) { return KINDS.computeIfAbsent(type.getName(), name -> toDocumentKind(type)); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, ...
Utils { public static String buildKind(Class<?> type) { return KINDS.computeIfAbsent(type.getName(), name -> toDocumentKind(type)); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, ...
@Test public void getSystemNowMicrosUtc() { CommandLineArgumentParser.parseFromProperties(this); long s = System.nanoTime() / 1000; for (int i = 0; i < this.iterationCount; i++) { Utils.getSystemNowMicrosUtc(); } long e = System.nanoTime() / 1000; double thpt = this.iterationCount / ((e - s) / 1000000.0); Logger.getAno...
public static long getSystemNowMicrosUtc() { return System.currentTimeMillis() * 1000; }
Utils { public static long getSystemNowMicrosUtc() { return System.currentTimeMillis() * 1000; } }
Utils { public static long getSystemNowMicrosUtc() { return System.currentTimeMillis() * 1000; } private Utils(); }
Utils { public static long getSystemNowMicrosUtc() { return System.currentTimeMillis() * 1000; } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer); s...
Utils { public static long getSystemNowMicrosUtc() { return System.currentTimeMillis() * 1000; } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer); s...
@Test public void toBytes() { final int expectedByteCount = 115; int count = 100000; ServiceDocument s = buildCloneOrSerializationObject(); int byteCount = 0; long start = System.nanoTime() / 1000; for (int i = 0; i < count; i++) { byte[] content = Utils.getBuffer(1024); byteCount = Utils.toBytes(s, content, 0); assert...
public static int toBytes(Object o, byte[] buffer, int position) { return KryoSerializers.serializeObject(o, buffer, position); }
Utils { public static int toBytes(Object o, byte[] buffer, int position) { return KryoSerializers.serializeObject(o, buffer, position); } }
Utils { public static int toBytes(Object o, byte[] buffer, int position) { return KryoSerializers.serializeObject(o, buffer, position); } private Utils(); }
Utils { public static int toBytes(Object o, byte[] buffer, int position) { return KryoSerializers.serializeObject(o, buffer, position); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, ...
Utils { public static int toBytes(Object o, byte[] buffer, int position) { return KryoSerializers.serializeObject(o, buffer, position); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, ...
@Test public void isWithinTimeComparisonEpsilon() { Utils.setTimeComparisonEpsilonMicros(TimeUnit.SECONDS.toMicros(10)); long l = Utils.getSystemNowMicrosUtc() + 1000; assertTrue(Utils.isWithinTimeComparisonEpsilon(l)); l = Utils.getSystemNowMicrosUtc() + TimeUnit.DAYS.toMicros(2); assertFalse(Utils.isWithinTimeCompari...
public static boolean isWithinTimeComparisonEpsilon(long timeMicros) { return Math.abs(timeMicros - Utils.getSystemNowMicrosUtc()) < timeComparisonEpsilon; }
Utils { public static boolean isWithinTimeComparisonEpsilon(long timeMicros) { return Math.abs(timeMicros - Utils.getSystemNowMicrosUtc()) < timeComparisonEpsilon; } }
Utils { public static boolean isWithinTimeComparisonEpsilon(long timeMicros) { return Math.abs(timeMicros - Utils.getSystemNowMicrosUtc()) < timeComparisonEpsilon; } private Utils(); }
Utils { public static boolean isWithinTimeComparisonEpsilon(long timeMicros) { return Math.abs(timeMicros - Utils.getSystemNowMicrosUtc()) < timeComparisonEpsilon; } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLoca...
Utils { public static boolean isWithinTimeComparisonEpsilon(long timeMicros) { return Math.abs(timeMicros - Utils.getSystemNowMicrosUtc()) < timeComparisonEpsilon; } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLoca...
@Test public void registerCustomKryoSerializer() { try { ExampleServiceState st = new ExampleServiceState(); st.id = UUID.randomUUID().toString(); st.counter = Utils.getNowMicrosUtc(); st.documentSelfLink = st.id; st.keyValues = new HashMap<>(); st.keyValues.put(st.id, st.id); int byteCountToObjectDefault = Utils.toByt...
public static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer) { KryoSerializers.register(kryoThreadLocal, isDocumentSerializer); }
Utils { public static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer) { KryoSerializers.register(kryoThreadLocal, isDocumentSerializer); } }
Utils { public static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer) { KryoSerializers.register(kryoThreadLocal, isDocumentSerializer); } private Utils(); }
Utils { public static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer) { KryoSerializers.register(kryoThreadLocal, isDocumentSerializer); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomK...
Utils { public static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer) { KryoSerializers.register(kryoThreadLocal, isDocumentSerializer); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomK...
@Test public void cloneDocumentAndObject() { int count = 100000; Object s = buildCloneOrSerializationObject(); long start = System.nanoTime() / 1000; for (int i = 0; i < count; i++) { s = Utils.cloneObject(s); Object foo = s; foo = Utils.cloneObject(foo); } long end = System.nanoTime() / 1000; double thpt = end - start...
public static <T> T cloneObject(T t) { return KryoSerializers.cloneObject(t); }
Utils { public static <T> T cloneObject(T t) { return KryoSerializers.cloneObject(t); } }
Utils { public static <T> T cloneObject(T t) { return KryoSerializers.cloneObject(t); } private Utils(); }
Utils { public static <T> T cloneObject(T t) { return KryoSerializers.cloneObject(t); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer); static T c...
Utils { public static <T> T cloneObject(T t) { return KryoSerializers.cloneObject(t); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolean isDocumentSerializer); static T c...
@Test public void fromBytes() { int count = 100000; Map<String, Long> s = new HashMap<>(); s.put(UUID.randomUUID().toString(), 1L); s.put(UUID.randomUUID().toString(), 2L); byte[] content = new byte[1024]; Utils.toBytes(s, content, 0); for (int i = 0; i < count; i++) { @SuppressWarnings("unchecked") Map<String, Long> s...
public static Object fromBytes(byte[] bytes) { return KryoSerializers.deserializeObject(bytes, 0, bytes.length); }
Utils { public static Object fromBytes(byte[] bytes) { return KryoSerializers.deserializeObject(bytes, 0, bytes.length); } }
Utils { public static Object fromBytes(byte[] bytes) { return KryoSerializers.deserializeObject(bytes, 0, bytes.length); } private Utils(); }
Utils { public static Object fromBytes(byte[] bytes) { return KryoSerializers.deserializeObject(bytes, 0, bytes.length); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolea...
Utils { public static Object fromBytes(byte[] bytes) { return KryoSerializers.deserializeObject(bytes, 0, bytes.length); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boolea...
@Test public void synchronizationRequestQueuing() throws Throwable { setUp(this.nodeCount); this.host.joinNodesAndVerifyConvergence(this.host.getPeerCount()); this.host.setNodeGroupQuorum(this.nodeCount); waitForReplicatedFactoryServiceAvailable( this.host.getPeerServiceUri(ExampleService.FACTORY_LINK), ServiceUriPaths...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
@Test public void benchmarkGetNowMicrosUtc() throws InterruptedException { CountDownLatch latch = new CountDownLatch(1); Thread[] threads = new Thread[NUM_THREADS]; final Exception[] e = { null }; for (int i = 0; i < threads.length; i++) { threads[i] = new Thread() { @Override public void run() { try { latch.await(); }...
public static long getNowMicrosUtc() { long now = System.currentTimeMillis() * 1000; long time = previousTimeValue.getAndIncrement(); if (now > time) { previousTimeValue.compareAndSet(time + 1, now); return previousTimeValue.getAndIncrement(); } else if (time - now > timeDriftThresholdMicros) { previousTimeValue.set(no...
Utils { public static long getNowMicrosUtc() { long now = System.currentTimeMillis() * 1000; long time = previousTimeValue.getAndIncrement(); if (now > time) { previousTimeValue.compareAndSet(time + 1, now); return previousTimeValue.getAndIncrement(); } else if (time - now > timeDriftThresholdMicros) { previousTimeValu...
Utils { public static long getNowMicrosUtc() { long now = System.currentTimeMillis() * 1000; long time = previousTimeValue.getAndIncrement(); if (now > time) { previousTimeValue.compareAndSet(time + 1, now); return previousTimeValue.getAndIncrement(); } else if (time - now > timeDriftThresholdMicros) { previousTimeValu...
Utils { public static long getNowMicrosUtc() { long now = System.currentTimeMillis() * 1000; long time = previousTimeValue.getAndIncrement(); if (now > time) { previousTimeValue.compareAndSet(time + 1, now); return previousTimeValue.getAndIncrement(); } else if (time - now > timeDriftThresholdMicros) { previousTimeValu...
Utils { public static long getNowMicrosUtc() { long now = System.currentTimeMillis() * 1000; long time = previousTimeValue.getAndIncrement(); if (now > time) { previousTimeValue.compareAndSet(time + 1, now); return previousTimeValue.getAndIncrement(); } else if (time - now > timeDriftThresholdMicros) { previousTimeValu...
@Test public void toJsonHtml() { ServiceDocument doc = new ServiceDocument(); String json = Utils.toJsonHtml(doc); assertTrue(json.contains(" ")); }
public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); }
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } }
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } private Utils(); }
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } private Utils(); static void registerCustomJsonMapper(Class<?> cl...
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } private Utils(); static void registerCustomJsonMapper(Class<?> cl...
@Test public void toJsonHtmlNull() { String json = Utils.toJsonHtml(null); assertEquals(json, "null"); }
public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); }
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } }
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } private Utils(); }
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } private Utils(); static void registerCustomJsonMapper(Class<?> cl...
Utils { public static String toJsonHtml(Object body) { if (body instanceof String) { return (String) body; } StringBuilder content = getBuilder(); JsonMapper mapper = getJsonMapperFor(body); mapper.toJsonHtml(body, content); return content.toString(); } private Utils(); static void registerCustomJsonMapper(Class<?> cl...
@Test public void validateServiceOption() { EnumSet<ServiceOption> options = EnumSet.of(ServiceOption.REPLICATION, ServiceOption.OWNER_SELECTION); checkOptions(options); options = EnumSet.of(ServiceOption.REPLICATION, ServiceOption.OWNER_SELECTION, ServiceOption.INSTRUMENTATION, ServiceOption.PERIODIC_MAINTENANCE, Serv...
public static String validateServiceOption(EnumSet<ServiceOption> options, ServiceOption option) { if (!options.contains(option)) { return null; } EnumSet<ServiceOption> reqs = EnumSet.noneOf(ServiceOption.class); EnumSet<ServiceOption> antiReqs = EnumSet.noneOf(ServiceOption.class); switch (option) { case CONCURRENT_U...
Utils { public static String validateServiceOption(EnumSet<ServiceOption> options, ServiceOption option) { if (!options.contains(option)) { return null; } EnumSet<ServiceOption> reqs = EnumSet.noneOf(ServiceOption.class); EnumSet<ServiceOption> antiReqs = EnumSet.noneOf(ServiceOption.class); switch (option) { case CONC...
Utils { public static String validateServiceOption(EnumSet<ServiceOption> options, ServiceOption option) { if (!options.contains(option)) { return null; } EnumSet<ServiceOption> reqs = EnumSet.noneOf(ServiceOption.class); EnumSet<ServiceOption> antiReqs = EnumSet.noneOf(ServiceOption.class); switch (option) { case CONC...
Utils { public static String validateServiceOption(EnumSet<ServiceOption> options, ServiceOption option) { if (!options.contains(option)) { return null; } EnumSet<ServiceOption> reqs = EnumSet.noneOf(ServiceOption.class); EnumSet<ServiceOption> antiReqs = EnumSet.noneOf(ServiceOption.class); switch (option) { case CONC...
Utils { public static String validateServiceOption(EnumSet<ServiceOption> options, ServiceOption option) { if (!options.contains(option)) { return null; } EnumSet<ServiceOption> reqs = EnumSet.noneOf(ServiceOption.class); EnumSet<ServiceOption> antiReqs = EnumSet.noneOf(ServiceOption.class); switch (option) { case CONC...
@Test public void testParseJsonWhenMapWithValueTypeObject() throws Exception { TestKeyObjectValueHolder testHolder = Utils.fromJson( "{\"keyValues\":{\"prop1\":\"value1\"}}", TestKeyObjectValueHolder.class); assertEquals("value1", testHolder.keyValues.get("prop1")); }
public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
@Test public void testParseInstant() throws Exception { Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("UTC")); cal.set(2013, 4, 30, 23, 38, 27); cal.set(Calendar.MILLISECOND, 85); Instant expected = cal.toInstant(); Instant actual = Utils.fromJson("\"2013-05-30T23:38:27.085Z\"", Instant.cl...
public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
@Test public void testGsonParserErrorSuppressed() throws JsonSyntaxException { this.expectedEx.expect(JsonSyntaxException.class); this.expectedEx.expectMessage("JSON body could not be parsed"); JsonMapper jsonMapper = new JsonMapper(); jsonMapper.setJsonSuppressGsonSerializationErrors(true); jsonMapper.fromJson("TEST",...
public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
@Test public void testGsonParserError() throws JsonSyntaxException { this.expectedEx.expect(JsonSyntaxException.class); this.expectedEx.expectMessage("Expected BEGIN_OBJECT but was STRING"); JsonMapper jsonMapper = new JsonMapper(); jsonMapper.fromJson("TEST", ExampleServiceState.class); }
public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
@Test public void testParseZonedDateTime() throws Exception { Calendar cal = Calendar.getInstance(); cal.setTimeZone(TimeZone.getTimeZone("Australia/Sydney")); cal.set(2013, 4, 30, 23, 38, 27); cal.set(Calendar.MILLISECOND, 85); ZoneId zid = ZoneId.of("Australia/Sydney"); ZonedDateTime expected = ZonedDateTime.ofInstan...
public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); }
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
Utils { public static <T> T fromJson(String json, Class<T> clazz) { return getJsonMapperFor(clazz).fromJson(json, clazz); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLocal<Kryo> kryoThreadLocal, boole...
@Test public void testServiceProvidedUiPath() { String resourcePath = "ui/exampleService"; class MyService extends StatelessService { @Override public ServiceDocument getDocumentTemplate() { ServiceDocument serviceDocument = new ServiceDocument(); serviceDocument.documentDescription = new ServiceDocumentDescription(); ...
public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return Paths.get...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
@Test public void replicationWithOutOfOrderPostAndUpdates() throws Throwable { setUp(this.nodeCount); this.host.joinNodesAndVerifyConvergence(this.host.getPeerCount()); this.host.setNodeGroupQuorum(this.nodeCount / 2 + 1); waitForReplicatedFactoryServiceAvailable( this.host.getPeerServiceUri(ExampleService.FACTORY_LINK...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
@Test public void testServiceProvidedUiPathEmpty() { class MyService extends StatelessService { @Override public ServiceDocument getDocumentTemplate() { ServiceDocument serviceDocument = new ServiceDocument(); serviceDocument.documentDescription = new ServiceDocumentDescription(); serviceDocument.documentDescription.us...
public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return Paths.get...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
Utils { public static Path getServiceUiResourcePath(Service s) { ServiceDocument sd = s.getDocumentTemplate(); ServiceDocumentDescription sdd = sd.documentDescription; if (sdd != null && sdd.userInterfaceResourcePath != null) { String resourcePath = sdd.userInterfaceResourcePath; if (!resourcePath.isEmpty()) { return P...
@Test public void testGetFromJsonMap() { String sampleJson = "{" + "\"key1\":\"val1\"," + "\"key2\":[\"val21\", \"val22\"]," + "\"key3\":{\"key31\":false,\"key32\":false}" + "}"; String val1 = Utils.getJsonMapValue(sampleJson, "key1", String.class); assertTrue(val1.equals("val1")); List<String> val2 = Utils.getJsonMapV...
public static <T> T getJsonMapValue(Object json, String key, Class<T> valueClazz) { JsonElement je = Utils.fromJson(json, JsonElement.class); je = je.getAsJsonObject().get(key); if (je == null) { return null; } return Utils.fromJson(je, valueClazz); }
Utils { public static <T> T getJsonMapValue(Object json, String key, Class<T> valueClazz) { JsonElement je = Utils.fromJson(json, JsonElement.class); je = je.getAsJsonObject().get(key); if (je == null) { return null; } return Utils.fromJson(je, valueClazz); } }
Utils { public static <T> T getJsonMapValue(Object json, String key, Class<T> valueClazz) { JsonElement je = Utils.fromJson(json, JsonElement.class); je = je.getAsJsonObject().get(key); if (je == null) { return null; } return Utils.fromJson(je, valueClazz); } private Utils(); }
Utils { public static <T> T getJsonMapValue(Object json, String key, Class<T> valueClazz) { JsonElement je = Utils.fromJson(json, JsonElement.class); je = je.getAsJsonObject().get(key); if (je == null) { return null; } return Utils.fromJson(je, valueClazz); } private Utils(); static void registerCustomJsonMapper(Class...
Utils { public static <T> T getJsonMapValue(Object json, String key, Class<T> valueClazz) { JsonElement je = Utils.fromJson(json, JsonElement.class); je = je.getAsJsonObject().get(key); if (je == null) { return null; } return Utils.fromJson(je, valueClazz); } private Utils(); static void registerCustomJsonMapper(Class...
@Test public void testDecodeUrlEncodedText() throws Throwable { String textPlain = "param1=value1&param2=value 2&param3=value три"; byte[] textEncoded = URLEncoder.encode(textPlain, Utils.CHARSET).getBytes(Utils.CHARSET); String textDecoded = Utils.decodeIfText(ByteBuffer.wrap(textEncoded), Operation.MEDIA_TYPE_APPLICA...
public static String decodeIfText(ByteBuffer buffer, String contentType) throws CharacterCodingException { if (contentType == null) { return null; } String body = null; if (isContentTypeText(contentType)) { CharsetDecoder decoder = decodersPerThread.get().reset(); body = decoder.decode(buffer).toString(); } else if (co...
Utils { public static String decodeIfText(ByteBuffer buffer, String contentType) throws CharacterCodingException { if (contentType == null) { return null; } String body = null; if (isContentTypeText(contentType)) { CharsetDecoder decoder = decodersPerThread.get().reset(); body = decoder.decode(buffer).toString(); } els...
Utils { public static String decodeIfText(ByteBuffer buffer, String contentType) throws CharacterCodingException { if (contentType == null) { return null; } String body = null; if (isContentTypeText(contentType)) { CharsetDecoder decoder = decodersPerThread.get().reset(); body = decoder.decode(buffer).toString(); } els...
Utils { public static String decodeIfText(ByteBuffer buffer, String contentType) throws CharacterCodingException { if (contentType == null) { return null; } String body = null; if (isContentTypeText(contentType)) { CharsetDecoder decoder = decodersPerThread.get().reset(); body = decoder.decode(buffer).toString(); } els...
Utils { public static String decodeIfText(ByteBuffer buffer, String contentType) throws CharacterCodingException { if (contentType == null) { return null; } String body = null; if (isContentTypeText(contentType)) { CharsetDecoder decoder = decodersPerThread.get().reset(); body = decoder.decode(buffer).toString(); } els...
@Test public void testValidateStateForUniqueIdentifier() { ExampleServiceState state = new ExampleServiceState(); state.id = null; state.required = "testRequiredField"; ServiceDocumentDescription desc = buildStateDescription(ExampleServiceState.class, null); Utils.validateState(desc, state); Assert.assertNotNull("Uniqu...
public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue(prop, s...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
@Test(expected = IllegalArgumentException.class) public void testValidateStateForRequiredField() { ExampleServiceState state = new ExampleServiceState(); state.id = null; state.required = null; ServiceDocumentDescription desc = buildStateDescription(ExampleServiceState.class, null); Utils.validateState(desc, state); }
public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue(prop, s...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
Utils { public static <T extends ServiceDocument> void validateState( ServiceDocumentDescription desc, T state) { for (PropertyDescription prop : desc.propertyDescriptions.values()) { if (prop.usageOptions != null && prop.usageOptions.contains(PropertyUsageOption.REQUIRED)) { Object o = ReflectionUtils.getPropertyValue...
@Test public void testDecodeGzipedResponseBody() throws Exception { String body = "This is the original body content, but gzipped"; byte[] gzippedBody = compress(body); Operation op = Operation .createGet(null) .setContentLength(gzippedBody.length) .addResponseHeader(Operation.CONTENT_ENCODING_HEADER, Operation.CONTENT...
public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getRequestHead...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
@Test public void testDecodeGzipedRequestBody() throws Exception { String body = "This is the original body content, but gzipped"; byte[] gzippedBody = compress(body); Operation op = Operation .createGet(null) .setContentLength(gzippedBody.length) .addRequestHeader(Operation.CONTENT_ENCODING_HEADER, Operation.CONTENT_E...
public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getRequestHead...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
@Test public void testFailsDecodeGzipedBodyWithoutContentEncoding() throws Exception { byte[] gzippedBody = compress("test"); Operation op = Operation .createGet(null) .setContentLength(gzippedBody.length) .addResponseHeader(Operation.CONTENT_TYPE_HEADER, Operation.MEDIA_TYPE_TEXT_PLAIN); try { Utils.decodeBody(op, Byt...
public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getRequestHead...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
Utils { public static void decodeBody(Operation op, ByteBuffer buffer, boolean isRequest) throws Exception { String contentEncodingHeader = null; if (!isRequest) { contentEncodingHeader = op.getResponseHeaderAsIs(Operation.CONTENT_ENCODING_HEADER); } else if (!op.isFromReplication()) { contentEncodingHeader = op.getReq...
@Test public void testEncodeGzipResponseBody() throws Throwable { String body = "This is the original body content, but gzipped"; byte[] gzippedBody = compress(body); Operation op = Operation .createGet(null) .setContentLength(body.length()) .setBody(body) .addRequestHeader(Operation.ACCEPT_ENCODING_HEADER, Operation.C...
public static byte[] encodeBody(Operation op, boolean isRequest) throws Exception { return encodeBody(op, op.getBodyRaw(), op.getContentType(), isRequest); }
Utils { public static byte[] encodeBody(Operation op, boolean isRequest) throws Exception { return encodeBody(op, op.getBodyRaw(), op.getContentType(), isRequest); } }
Utils { public static byte[] encodeBody(Operation op, boolean isRequest) throws Exception { return encodeBody(op, op.getBodyRaw(), op.getContentType(), isRequest); } private Utils(); }
Utils { public static byte[] encodeBody(Operation op, boolean isRequest) throws Exception { return encodeBody(op, op.getBodyRaw(), op.getContentType(), isRequest); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLoca...
Utils { public static byte[] encodeBody(Operation op, boolean isRequest) throws Exception { return encodeBody(op, op.getBodyRaw(), op.getContentType(), isRequest); } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, JsonMapper mapper); static void registerCustomKryoSerializer(ThreadLoca...
@Test public void testComputeSignature() throws Exception { ServiceDocumentDescription sdd = TestUtils.buildStateDescription( TestInvalidComputerSignatureState.class, null); TestInvalidComputerSignatureState state1 = new TestInvalidComputerSignatureState(); state1.key1 = "1"; state1.key2 = null; TestInvalidComputerSign...
public static String computeSignature(ServiceDocument s, ServiceDocumentDescription description) { if (description == null) { throw new IllegalArgumentException("description is required"); } long hash = FNVHash.FNV_OFFSET_MINUS_MSB; for (PropertyDescription pd : description.propertyDescriptions.values()) { if (pd.index...
Utils { public static String computeSignature(ServiceDocument s, ServiceDocumentDescription description) { if (description == null) { throw new IllegalArgumentException("description is required"); } long hash = FNVHash.FNV_OFFSET_MINUS_MSB; for (PropertyDescription pd : description.propertyDescriptions.values()) { if (...
Utils { public static String computeSignature(ServiceDocument s, ServiceDocumentDescription description) { if (description == null) { throw new IllegalArgumentException("description is required"); } long hash = FNVHash.FNV_OFFSET_MINUS_MSB; for (PropertyDescription pd : description.propertyDescriptions.values()) { if (...
Utils { public static String computeSignature(ServiceDocument s, ServiceDocumentDescription description) { if (description == null) { throw new IllegalArgumentException("description is required"); } long hash = FNVHash.FNV_OFFSET_MINUS_MSB; for (PropertyDescription pd : description.propertyDescriptions.values()) { if (...
Utils { public static String computeSignature(ServiceDocument s, ServiceDocumentDescription description) { if (description == null) { throw new IllegalArgumentException("description is required"); } long hash = FNVHash.FNV_OFFSET_MINUS_MSB; for (PropertyDescription pd : description.propertyDescriptions.values()) { if (...
@Test public void replicationInMemoryWithOutOfOrderPostAndUpdates() throws Throwable { setUp(this.nodeCount); this.host.joinNodesAndVerifyConvergence(this.host.getPeerCount()); this.host.setNodeGroupQuorum(this.nodeCount / 2 + 1); for (VerificationHost h : this.host.getInProcessHostMap().values()) { h.startServiceAndWa...
@Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); }
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
NodeGroupService extends StatefulService { @Override public URI getUri() { if (this.uri == null) { this.uri = super.getUri(); } return this.uri; } NodeGroupService(); @Override URI getUri(); @Override void handleStart(Operation startPost); @Override void handleGet(Operation get); @Override void handlePatch(Operation pa...
@Test public void testBuildServiceConfig() { Service exampleService = new ExampleService(); exampleService.setHost(VerificationHost.create()); ServiceConfiguration config = new ServiceConfiguration(); Utils.buildServiceConfig(config, exampleService); assertEquals(exampleService.getOptions(), config.options); assertEqua...
public static <T extends ServiceConfiguration> T buildServiceConfig(T config, Service service) { ServiceDocumentDescription desc = service.getHost().buildDocumentDescription(service); config.options = service.getOptions(); config.maintenanceIntervalMicros = service.getMaintenanceIntervalMicros(); config.versionRetentio...
Utils { public static <T extends ServiceConfiguration> T buildServiceConfig(T config, Service service) { ServiceDocumentDescription desc = service.getHost().buildDocumentDescription(service); config.options = service.getOptions(); config.maintenanceIntervalMicros = service.getMaintenanceIntervalMicros(); config.version...
Utils { public static <T extends ServiceConfiguration> T buildServiceConfig(T config, Service service) { ServiceDocumentDescription desc = service.getHost().buildDocumentDescription(service); config.options = service.getOptions(); config.maintenanceIntervalMicros = service.getMaintenanceIntervalMicros(); config.version...
Utils { public static <T extends ServiceConfiguration> T buildServiceConfig(T config, Service service) { ServiceDocumentDescription desc = service.getHost().buildDocumentDescription(service); config.options = service.getOptions(); config.maintenanceIntervalMicros = service.getMaintenanceIntervalMicros(); config.version...
Utils { public static <T extends ServiceConfiguration> T buildServiceConfig(T config, Service service) { ServiceDocumentDescription desc = service.getHost().buildDocumentDescription(service); config.options = service.getOptions(); config.maintenanceIntervalMicros = service.getMaintenanceIntervalMicros(); config.version...
@Test public void hashJsonMaps() { Map<String, String> asc = new TreeMap<>(); for (int i = 0; i < 50; i++) { asc.put(UUID.randomUUID().toString(), UUID.randomUUID().toString()); } Map<String, String> desc = new TreeMap<>(Comparator.reverseOrder()); desc.putAll(asc); Map<String, String> juh = new HashMap<>(); juh.putAll...
public static String toString(Throwable t) { if (t == null) { return null; } else { StringWriter writer = new StringWriter(); try (PrintWriter printer = new PrintWriter(writer)) { t.printStackTrace(printer); } return writer.toString(); } }
Utils { public static String toString(Throwable t) { if (t == null) { return null; } else { StringWriter writer = new StringWriter(); try (PrintWriter printer = new PrintWriter(writer)) { t.printStackTrace(printer); } return writer.toString(); } } }
Utils { public static String toString(Throwable t) { if (t == null) { return null; } else { StringWriter writer = new StringWriter(); try (PrintWriter printer = new PrintWriter(writer)) { t.printStackTrace(printer); } return writer.toString(); } } private Utils(); }
Utils { public static String toString(Throwable t) { if (t == null) { return null; } else { StringWriter writer = new StringWriter(); try (PrintWriter printer = new PrintWriter(writer)) { t.printStackTrace(printer); } return writer.toString(); } } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, ...
Utils { public static String toString(Throwable t) { if (t == null) { return null; } else { StringWriter writer = new StringWriter(); try (PrintWriter printer = new PrintWriter(writer)) { t.printStackTrace(printer); } return writer.toString(); } } private Utils(); static void registerCustomJsonMapper(Class<?> clazz, ...
@Test public void testCounterServiceWithOperationFilters() throws Throwable { Service counterService = createCounterService(); OperationProcessingChain opProcessingChain = OperationProcessingChain.create( new OperationLogger()); counterService.setOperationProcessingChain(opProcessingChain); for (int i = 0; i < COUNT; i...
public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; }
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } }
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } private OperationProcessingChain...
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } private OperationProcessingChain...
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } private OperationProcessingChain...
@Test public void testCounterServiceJumpOperationProcessingStage() throws Throwable { Service counterService = createCounterService(); OperationProcessingChain opProcessingChain = OperationProcessingChain.create( new OperationLogger(), new OperationNextFiltersBypasser(counterService), new OperationPatchDropper()); coun...
public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; }
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } }
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } private OperationProcessingChain...
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } private OperationProcessingChain...
OperationProcessingChain { public static OperationProcessingChain create(Filter... filters) { OperationProcessingChain opProcessingChain = new OperationProcessingChain(); for (Filter filter : filters) { filter.init(); opProcessingChain.filters.add(filter); } return opProcessingChain; } private OperationProcessingChain...
@Test public void throughputPostRemote() throws Throwable { if (this.testURI == null) { return; } this.host.setOperationTimeOutMicros(TimeUnit.SECONDS.toMicros(120)); this.host.setTimeoutSeconds(120); this.host.log( "Starting HTTP POST stress test against %s, request count: %d, connection limit: %d", this.testURI, this...
private void sendHttpRequest(Operation op) { final Object originalBody = op.getBodyRaw(); try { byte[] body = Utils.encodeBody(op, true); if (op.getContentLength() > getRequestPayloadSizeLimit()) { String error = String.format("Content length %d, limit is %d", op.getContentLength(), getRequestPayloadSizeLimit()); Excep...
NettyHttpServiceClient implements ServiceClient { private void sendHttpRequest(Operation op) { final Object originalBody = op.getBodyRaw(); try { byte[] body = Utils.encodeBody(op, true); if (op.getContentLength() > getRequestPayloadSizeLimit()) { String error = String.format("Content length %d, limit is %d", op.getCon...
NettyHttpServiceClient implements ServiceClient { private void sendHttpRequest(Operation op) { final Object originalBody = op.getBodyRaw(); try { byte[] body = Utils.encodeBody(op, true); if (op.getContentLength() > getRequestPayloadSizeLimit()) { String error = String.format("Content length %d, limit is %d", op.getCon...
NettyHttpServiceClient implements ServiceClient { private void sendHttpRequest(Operation op) { final Object originalBody = op.getBodyRaw(); try { byte[] body = Utils.encodeBody(op, true); if (op.getContentLength() > getRequestPayloadSizeLimit()) { String error = String.format("Content length %d, limit is %d", op.getCon...
NettyHttpServiceClient implements ServiceClient { private void sendHttpRequest(Operation op) { final Object originalBody = op.getBodyRaw(); try { byte[] body = Utils.encodeBody(op, true); if (op.getContentLength() > getRequestPayloadSizeLimit()) { String error = String.format("Content length %d, limit is %d", op.getCon...
@Test public void httpsFailure() throws Throwable { List<Service> services = this.host.doThroughputServiceStart(10, MinimalTestService.class, this.host.buildMinimalTestState(), null, null); List<URI> uris = new ArrayList<>(); for (Service s : services) { URI u = UriUtils.extendUri(this.host.getSecureUri(), s.getSelfLin...
@Override public void send(Operation op) { sendRequest(op); }
NettyHttpServiceClient implements ServiceClient { @Override public void send(Operation op) { sendRequest(op); } }
NettyHttpServiceClient implements ServiceClient { @Override public void send(Operation op) { sendRequest(op); } }
NettyHttpServiceClient implements ServiceClient { @Override public void send(Operation op) { sendRequest(op); } static ServiceClient create(String userAgent, ExecutorService executor, ScheduledExecutorService scheduledExecutor); static ServiceClient create(String userAgent, Executor...
NettyHttpServiceClient implements ServiceClient { @Override public void send(Operation op) { sendRequest(op); } static ServiceClient create(String userAgent, ExecutorService executor, ScheduledExecutorService scheduledExecutor); static ServiceClient create(String userAgent, Executor...
@Test public void testGetExpirationTime() throws Throwable { BasicAuthenticationService basicAuthenticationService = new BasicAuthenticationService(); AuthenticationRequest authRequest = new AuthenticationRequest(); authRequest.sessionExpirationSeconds = null; long expectedSec = Instant.now().getEpochSecond() + BasicAu...
protected long getExpirationTime(AuthenticationRequest authRequest) { long expirationTimeSeconds = authRequest.sessionExpirationSeconds != null ? authRequest.sessionExpirationSeconds : AUTH_TOKEN_EXPIRATION_SECONDS; if (this.UPPER_SESSION_LIMIT_SECONDS != null && expirationTimeSeconds > this.UPPER_SESSION_LIMIT_SECONDS...
BasicAuthenticationService extends StatelessService { protected long getExpirationTime(AuthenticationRequest authRequest) { long expirationTimeSeconds = authRequest.sessionExpirationSeconds != null ? authRequest.sessionExpirationSeconds : AUTH_TOKEN_EXPIRATION_SECONDS; if (this.UPPER_SESSION_LIMIT_SECONDS != null && ex...
BasicAuthenticationService extends StatelessService { protected long getExpirationTime(AuthenticationRequest authRequest) { long expirationTimeSeconds = authRequest.sessionExpirationSeconds != null ? authRequest.sessionExpirationSeconds : AUTH_TOKEN_EXPIRATION_SECONDS; if (this.UPPER_SESSION_LIMIT_SECONDS != null && ex...
BasicAuthenticationService extends StatelessService { protected long getExpirationTime(AuthenticationRequest authRequest) { long expirationTimeSeconds = authRequest.sessionExpirationSeconds != null ? authRequest.sessionExpirationSeconds : AUTH_TOKEN_EXPIRATION_SECONDS; if (this.UPPER_SESSION_LIMIT_SECONDS != null && ex...
BasicAuthenticationService extends StatelessService { protected long getExpirationTime(AuthenticationRequest authRequest) { long expirationTimeSeconds = authRequest.sessionExpirationSeconds != null ? authRequest.sessionExpirationSeconds : AUTH_TOKEN_EXPIRATION_SECONDS; if (this.UPPER_SESSION_LIMIT_SECONDS != null && ex...
@Test public void create() throws Throwable { String link = ExampleService.FACTORY_LINK; Service s = this.host.startServiceAndWait(new MinimalTestService(), UUID.randomUUID().toString(), null); Action a = Action.POST; Operation op = Operation.createPost(this.host, link); verifyOp(link, a, op); op = Operation.createPost...
public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = UriUtils.buildUri(host, ctx.path, ...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
@Test public void nestCompletion() throws Throwable { TestContext ctx = testCreate(1); Operation op = Operation.createGet(this.host.getUri()).setCompletion(ctx.getCompletion()); op.nestCompletion((o) -> { op.complete(); }); op.complete(); ctx.await(); ctx = testCreate(1); Operation opWithFail = Operation.createGet(this...
public Operation nestCompletion(CompletionHandler h) { CompletionHandler existing = this.completion; this.completion = (o, e) -> { this.statusCode = o.statusCode; this.completion = existing; h.handle(o, e); }; return this; }
Operation implements Cloneable { public Operation nestCompletion(CompletionHandler h) { CompletionHandler existing = this.completion; this.completion = (o, e) -> { this.statusCode = o.statusCode; this.completion = existing; h.handle(o, e); }; return this; } }
Operation implements Cloneable { public Operation nestCompletion(CompletionHandler h) { CompletionHandler existing = this.completion; this.completion = (o, e) -> { this.statusCode = o.statusCode; this.completion = existing; h.handle(o, e); }; return this; } Operation(); }
Operation implements Cloneable { public Operation nestCompletion(CompletionHandler h) { CompletionHandler existing = this.completion; this.completion = (o, e) -> { this.statusCode = o.statusCode; this.completion = existing; h.handle(o, e); }; return this; } Operation(); static void fail(Operation request, int statusCod...
Operation implements Cloneable { public Operation nestCompletion(CompletionHandler h) { CompletionHandler existing = this.completion; this.completion = (o, e) -> { this.statusCode = o.statusCode; this.completion = existing; h.handle(o, e); }; return this; } Operation(); static void fail(Operation request, int statusCod...
@Test public void completion() throws Throwable { boolean[] isSuccessHandlerCalled = new boolean[] { false }; boolean[] isFailureHandlerCalled = new boolean[] { false }; Consumer<Operation> successHandler = op -> isSuccessHandlerCalled[0] = true; CompletionHandler failureHandler = (op, e) -> isFailureHandlerCalled[0] =...
public Operation setCompletion(CompletionHandler completion) { this.completion = completion; return this; }
Operation implements Cloneable { public Operation setCompletion(CompletionHandler completion) { this.completion = completion; return this; } }
Operation implements Cloneable { public Operation setCompletion(CompletionHandler completion) { this.completion = completion; return this; } Operation(); }
Operation implements Cloneable { public Operation setCompletion(CompletionHandler completion) { this.completion = completion; return this; } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(...
Operation implements Cloneable { public Operation setCompletion(CompletionHandler completion) { this.completion = completion; return this; } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(...
@Test public void testSendWithOnHost() throws Throwable { testSendWith((o) -> o.sendWith(this.host)); }
public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(Operation request, int error...
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(Operation request, int error...
@Test public void testSendWithOnService() throws Throwable { testSendWith((o) -> o.sendWith(this.services.get(0))); }
public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(Operation request, int error...
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(Operation request, int error...
@Test public void testSendWithOnServiceClient() throws Throwable { testSendWith((o) -> o.sendWith(this.host.getClient())); }
public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); }
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(Operation request, int error...
Operation implements Cloneable { public void sendWith(ServiceRequestSender sender) { sender.sendRequest(this); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation request); static void failLimitExceeded(Operation request, int error...
@Test public void toBroadcastResult() { String hostSuccess1 = "host-success1"; String hostSuccess2 = "host-success2"; String hostSuccess3 = "host-success3"; String hostFailure = "host-fail"; URI successUri1 = URI.create("http: URI successUri2 = URI.create("http: URI successUri3 = URI.create("http: URI failureUri = URI....
public static NodeGroupBroadcastResult toBroadcastResult(NodeGroupBroadcastResponse response) { NodeGroupBroadcastResult result = new NodeGroupBroadcastResult(); result.totalNodeCount = response.nodeCount; result.availableNodeCount = response.availableNodeCount; result.unavailableNodeCount = response.nodeCount - respon...
NodeGroupUtils { public static NodeGroupBroadcastResult toBroadcastResult(NodeGroupBroadcastResponse response) { NodeGroupBroadcastResult result = new NodeGroupBroadcastResult(); result.totalNodeCount = response.nodeCount; result.availableNodeCount = response.availableNodeCount; result.unavailableNodeCount = response.n...
NodeGroupUtils { public static NodeGroupBroadcastResult toBroadcastResult(NodeGroupBroadcastResponse response) { NodeGroupBroadcastResult result = new NodeGroupBroadcastResult(); result.totalNodeCount = response.nodeCount; result.availableNodeCount = response.availableNodeCount; result.unavailableNodeCount = response.n...
NodeGroupUtils { public static NodeGroupBroadcastResult toBroadcastResult(NodeGroupBroadcastResponse response) { NodeGroupBroadcastResult result = new NodeGroupBroadcastResult(); result.totalNodeCount = response.nodeCount; result.availableNodeCount = response.availableNodeCount; result.unavailableNodeCount = response.n...
NodeGroupUtils { public static NodeGroupBroadcastResult toBroadcastResult(NodeGroupBroadcastResponse response) { NodeGroupBroadcastResult result = new NodeGroupBroadcastResult(); result.totalNodeCount = response.nodeCount; result.availableNodeCount = response.availableNodeCount; result.unavailableNodeCount = response.n...
@Test public void testErrorCodes() throws Throwable { ServiceErrorResponse rsp = ServiceErrorResponse.create( new IllegalArgumentException(), Operation.STATUS_CODE_BAD_REQUEST); rsp.setErrorCode(123123); assertEquals(rsp.getErrorCode(), 123123); rsp.setInternalErrorCode(0x81234567); assertEquals(rsp.getErrorCode(), 0x8...
public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = UriUtils.buildUri(host, ctx.path, ...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
@Test(expected = IllegalArgumentException.class) public void testNonXenonErrorCode() throws Throwable { ServiceErrorResponse rsp = ServiceErrorResponse.create( new IllegalArgumentException(), Operation.STATUS_CODE_BAD_REQUEST); rsp.setErrorCode(0x81234567); }
public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = UriUtils.buildUri(host, ctx.path, ...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
@Test(expected = IllegalArgumentException.class) public void testXenonErrorCode() throws Throwable { ServiceErrorResponse rsp = ServiceErrorResponse.create( new IllegalArgumentException(), Operation.STATUS_CODE_BAD_REQUEST); rsp.setInternalErrorCode(123123); }
public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = UriUtils.buildUri(host, ctx.path, ...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
Operation implements Cloneable { public static Operation create(SerializedOperation ctx, ServiceHost host) { Operation op = new Operation(); op.action = ctx.action; op.body = ctx.jsonBody; op.expirationMicrosUtc = ctx.documentExpirationTimeMicros; op.setContextId(ctx.id.toString()); op.referer = ctx.referer; op.uri = U...
@Test public void testIsNotification() throws Throwable { Operation op = Operation.createGet(null); assertFalse(op.isNotification()); op.addPragmaDirective(Operation.PRAGMA_DIRECTIVE_SKIPPED_NOTIFICATIONS); assertFalse(op.isNotification()); final String notificationPragma = "xn-nt"; op.addPragmaDirective(notificationPr...
public boolean isNotification() { return this.hasOption(OperationOption.NOTIFICATION) || hasPragmaDirective(PRAGMA_DIRECTIVE_NOTIFICATION); }
Operation implements Cloneable { public boolean isNotification() { return this.hasOption(OperationOption.NOTIFICATION) || hasPragmaDirective(PRAGMA_DIRECTIVE_NOTIFICATION); } }
Operation implements Cloneable { public boolean isNotification() { return this.hasOption(OperationOption.NOTIFICATION) || hasPragmaDirective(PRAGMA_DIRECTIVE_NOTIFICATION); } Operation(); }
Operation implements Cloneable { public boolean isNotification() { return this.hasOption(OperationOption.NOTIFICATION) || hasPragmaDirective(PRAGMA_DIRECTIVE_NOTIFICATION); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation reques...
Operation implements Cloneable { public boolean isNotification() { return this.hasOption(OperationOption.NOTIFICATION) || hasPragmaDirective(PRAGMA_DIRECTIVE_NOTIFICATION); } Operation(); static void fail(Operation request, int statusCode, int errorCode, Throwable e); static void failActionNotSupported(Operation reques...
@Test public void copyTo() throws Throwable { assertEquals(25, ServiceDocument.class.getFields().length); ServiceDocument one = new ServiceDocument(); one.documentAuthPrincipalLink = UUID.randomUUID().toString(); one.documentDescription = null; one.documentEpoch = Utils.getNowMicrosUtc(); one.documentExpirationTimeMicr...
public void copyTo(ServiceDocument target) { target.documentEpoch = this.documentEpoch; target.documentDescription = this.documentDescription; target.documentOwner = this.documentOwner; target.documentSourceLink = this.documentSourceLink; target.documentVersion = this.documentVersion; target.documentKind = this.documen...
ServiceDocument { public void copyTo(ServiceDocument target) { target.documentEpoch = this.documentEpoch; target.documentDescription = this.documentDescription; target.documentOwner = this.documentOwner; target.documentSourceLink = this.documentSourceLink; target.documentVersion = this.documentVersion; target.documentK...
ServiceDocument { public void copyTo(ServiceDocument target) { target.documentEpoch = this.documentEpoch; target.documentDescription = this.documentDescription; target.documentOwner = this.documentOwner; target.documentSourceLink = this.documentSourceLink; target.documentVersion = this.documentVersion; target.documentK...
ServiceDocument { public void copyTo(ServiceDocument target) { target.documentEpoch = this.documentEpoch; target.documentDescription = this.documentDescription; target.documentOwner = this.documentOwner; target.documentSourceLink = this.documentSourceLink; target.documentVersion = this.documentVersion; target.documentK...
ServiceDocument { public void copyTo(ServiceDocument target) { target.documentEpoch = this.documentEpoch; target.documentDescription = this.documentDescription; target.documentOwner = this.documentOwner; target.documentSourceLink = this.documentSourceLink; target.documentVersion = this.documentVersion; target.documentK...
@Test public void equals() throws Throwable { ServiceDocumentDescription description = TestUtils.buildStateDescription( ComparableServiceState.class, null); ComparableServiceState initialState = new ComparableServiceState(); initialState.name = UUID.randomUUID().toString(); initialState.counter = 5L; initialState.boole...
public static boolean equals(ServiceDocumentDescription description, ServiceDocument currentDocument, ServiceDocument newDocument) { if (currentDocument == null || newDocument == null) { throw new IllegalArgumentException( "Null Service documents cannot be checked for equality."); } try { String currentSignature = Util...
ServiceDocument { public static boolean equals(ServiceDocumentDescription description, ServiceDocument currentDocument, ServiceDocument newDocument) { if (currentDocument == null || newDocument == null) { throw new IllegalArgumentException( "Null Service documents cannot be checked for equality."); } try { String curre...
ServiceDocument { public static boolean equals(ServiceDocumentDescription description, ServiceDocument currentDocument, ServiceDocument newDocument) { if (currentDocument == null || newDocument == null) { throw new IllegalArgumentException( "Null Service documents cannot be checked for equality."); } try { String curre...
ServiceDocument { public static boolean equals(ServiceDocumentDescription description, ServiceDocument currentDocument, ServiceDocument newDocument) { if (currentDocument == null || newDocument == null) { throw new IllegalArgumentException( "Null Service documents cannot be checked for equality."); } try { String curre...
ServiceDocument { public static boolean equals(ServiceDocumentDescription description, ServiceDocument currentDocument, ServiceDocument newDocument) { if (currentDocument == null || newDocument == null) { throw new IllegalArgumentException( "Null Service documents cannot be checked for equality."); } try { String curre...
@Test public void compare() throws Throwable { ServiceDocumentDescription description = TestUtils.buildStateDescription( ExampleService.ExampleServiceState.class, null); ExampleService.ExampleServiceState stateA = new ExampleService.ExampleServiceState(); ExampleService.ExampleServiceState stateB = new ExampleService.E...
public static EnumSet<DocumentRelationship> compare(ServiceDocument stateA, ServiceDocument stateB, ServiceDocumentDescription desc, long timeEpsilon) { boolean preferred = false; EnumSet<DocumentRelationship> results = EnumSet.noneOf(DocumentRelationship.class); long timeDifference; if (stateB == null) { results.add(D...
ServiceDocument { public static EnumSet<DocumentRelationship> compare(ServiceDocument stateA, ServiceDocument stateB, ServiceDocumentDescription desc, long timeEpsilon) { boolean preferred = false; EnumSet<DocumentRelationship> results = EnumSet.noneOf(DocumentRelationship.class); long timeDifference; if (stateB == nul...
ServiceDocument { public static EnumSet<DocumentRelationship> compare(ServiceDocument stateA, ServiceDocument stateB, ServiceDocumentDescription desc, long timeEpsilon) { boolean preferred = false; EnumSet<DocumentRelationship> results = EnumSet.noneOf(DocumentRelationship.class); long timeDifference; if (stateB == nul...
ServiceDocument { public static EnumSet<DocumentRelationship> compare(ServiceDocument stateA, ServiceDocument stateB, ServiceDocumentDescription desc, long timeEpsilon) { boolean preferred = false; EnumSet<DocumentRelationship> results = EnumSet.noneOf(DocumentRelationship.class); long timeDifference; if (stateB == nul...
ServiceDocument { public static EnumSet<DocumentRelationship> compare(ServiceDocument stateA, ServiceDocument stateB, ServiceDocumentDescription desc, long timeEpsilon) { boolean preferred = false; EnumSet<DocumentRelationship> results = EnumSet.noneOf(DocumentRelationship.class); long timeDifference; if (stateB == nul...
@Test public void documentGetStats() throws Throwable { setUpHost(false); List<String> docLinks = new ArrayList<String>(); MinimalFactoryTestService f = new MinimalFactoryTestService(); MinimalFactoryTestService factoryService = (MinimalFactoryTestService) this.host .startServiceAndWait(f, UUID.randomUUID().toString(),...
@Override public URI getUri() { return this.uri; }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); }
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
LuceneDocumentIndexService extends StatelessService { @Override public URI getUri() { return this.uri; } LuceneDocumentIndexService(); LuceneDocumentIndexService(String indexDirectory); static void setImplicitQueryResultLimit(int limit); static int getImplicitQueryResultLimit(); static void setImplicitQueryProcessingP...
@Test public void testCompareAndIncreaseOnly() { AtomicLong target = new AtomicLong(5); assertThat(MixAll.compareAndIncreaseOnly(target, 6)).isTrue(); assertThat(target.get()).isEqualTo(6); assertThat(MixAll.compareAndIncreaseOnly(target, 4)).isFalse(); assertThat(target.get()).isEqualTo(6); }
public static boolean compareAndIncreaseOnly(final AtomicLong target, final long value) { long prev = target.get(); while (value > prev) { boolean updated = target.compareAndSet(prev, value); if (updated) return true; prev = target.get(); } return false; }
MixAll { public static boolean compareAndIncreaseOnly(final AtomicLong target, final long value) { long prev = target.get(); while (value > prev) { boolean updated = target.compareAndSet(prev, value); if (updated) return true; prev = target.get(); } return false; } }
MixAll { public static boolean compareAndIncreaseOnly(final AtomicLong target, final long value) { long prev = target.get(); while (value > prev) { boolean updated = target.compareAndSet(prev, value); if (updated) return true; prev = target.get(); } return false; } }
MixAll { public static boolean compareAndIncreaseOnly(final AtomicLong target, final long value) { long prev = target.get(); while (value > prev) { boolean updated = target.compareAndSet(prev, value); if (updated) return true; prev = target.get(); } return false; } static String getWSAddr(); static String getRetryTopi...
MixAll { public static boolean compareAndIncreaseOnly(final AtomicLong target, final long value) { long prev = target.get(); while (value > prev) { boolean updated = target.compareAndSet(prev, value); if (updated) return true; prev = target.get(); } return false; } static String getWSAddr(); static String getRetryTopi...
@Test public void testFile2String() throws IOException { String fileName = System.getProperty("java.io.tmpdir") + File.separator + "MixAllTest" + System.currentTimeMillis(); File file = new File(fileName); if (file.exists()) { file.delete(); } file.createNewFile(); PrintWriter out = new PrintWriter(fileName); out.write...
public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); }
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } }
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } }
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } static String getWSAddr(); static String getRetryTopic(final String consumerGroup); static boolean isSysConsumerGroup(final String consumerGroup); static boolean isSystemTop...
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } static String getWSAddr(); static String getRetryTopic(final String consumerGroup); static boolean isSysConsumerGroup(final String consumerGroup); static boolean isSystemTop...
@Test public void testFile2String_WithChinese() throws IOException { String fileName = System.getProperty("java.io.tmpdir") + File.separator + "MixAllTest" + System.currentTimeMillis(); File file = new File(fileName); if (file.exists()) { file.delete(); } file.createNewFile(); PrintWriter out = new PrintWriter(fileName...
public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); }
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } }
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } }
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } static String getWSAddr(); static String getRetryTopic(final String consumerGroup); static boolean isSysConsumerGroup(final String consumerGroup); static boolean isSystemTop...
MixAll { public static String file2String(final String fileName) throws IOException { File file = new File(fileName); return file2String(file); } static String getWSAddr(); static String getRetryTopic(final String consumerGroup); static boolean isSysConsumerGroup(final String consumerGroup); static boolean isSystemTop...
@Test public void testString2File() throws IOException { String fileName = System.getProperty("java.io.tmpdir") + File.separator + "MixAllTest" + System.currentTimeMillis(); MixAll.string2File("MixAll_testString2File", fileName); assertThat(MixAll.file2String(fileName)).isEqualTo("MixAll_testString2File"); }
public static void string2File(final String str, final String fileName) throws IOException { String tmpFile = fileName + ".tmp"; string2FileNotSafe(str, tmpFile); String bakFile = fileName + ".bak"; String prevContent = file2String(fileName); if (prevContent != null) { string2FileNotSafe(prevContent, bakFile); } File f...
MixAll { public static void string2File(final String str, final String fileName) throws IOException { String tmpFile = fileName + ".tmp"; string2FileNotSafe(str, tmpFile); String bakFile = fileName + ".bak"; String prevContent = file2String(fileName); if (prevContent != null) { string2FileNotSafe(prevContent, bakFile);...
MixAll { public static void string2File(final String str, final String fileName) throws IOException { String tmpFile = fileName + ".tmp"; string2FileNotSafe(str, tmpFile); String bakFile = fileName + ".bak"; String prevContent = file2String(fileName); if (prevContent != null) { string2FileNotSafe(prevContent, bakFile);...
MixAll { public static void string2File(final String str, final String fileName) throws IOException { String tmpFile = fileName + ".tmp"; string2FileNotSafe(str, tmpFile); String bakFile = fileName + ".bak"; String prevContent = file2String(fileName); if (prevContent != null) { string2FileNotSafe(prevContent, bakFile);...
MixAll { public static void string2File(final String str, final String fileName) throws IOException { String tmpFile = fileName + ".tmp"; string2FileNotSafe(str, tmpFile); String bakFile = fileName + ".bak"; String prevContent = file2String(fileName); if (prevContent != null) { string2FileNotSafe(prevContent, bakFile);...
@Test public void testPullMessage_Success() throws Exception { doAnswer(new Answer() { @Override public Object answer(InvocationOnMock mock) throws Throwable { PullMessageRequestHeader requestHeader = mock.getArgument(1); return createPullResult(requestHeader, PullStatus.FOUND, Collections.singletonList(new MessageExt(...
@Override public PullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, InterruptedException { return this.defaultMQPullConsumerImpl.pull(mq, subExpression, offset, maxNums); }
DefaultMQPullConsumer extends ClientConfig implements MQPullConsumer { @Override public PullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, InterruptedException { return this.defaultMQPullConsumerImpl.pull(mq, subExpression, of...
DefaultMQPullConsumer extends ClientConfig implements MQPullConsumer { @Override public PullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, InterruptedException { return this.defaultMQPullConsumerImpl.pull(mq, subExpression, of...
DefaultMQPullConsumer extends ClientConfig implements MQPullConsumer { @Override public PullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, InterruptedException { return this.defaultMQPullConsumerImpl.pull(mq, subExpression, of...
DefaultMQPullConsumer extends ClientConfig implements MQPullConsumer { @Override public PullResult pull(MessageQueue mq, String subExpression, long offset, int maxNums) throws MQClientException, RemotingException, MQBrokerException, InterruptedException { return this.defaultMQPullConsumerImpl.pull(mq, subExpression, of...