method2testcases stringlengths 118 6.63k |
|---|
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String uri() { if (uri == null) { String path = path().equals("/") ? "" : path(); uri = scheme() + ": if (query().length() > 0) { uri = uri + "?" + query(); }; } return uri; } HttpServerRequestImpl(String localHost, int localPort, JsonO... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String path() { return request.getString("path"); } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Over... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String query() { if (query == null) { StringBuilder queryBuilder = new StringBuilder(); for (Map.Entry<String, String> param : params()) { if (queryBuilder.length() > 0) { queryBuilder.append("&"); } queryBuilder.append(urlEncode(param.... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String host() { return localHost; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Override HttpServerR... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public HttpServerResponse response() { return response; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Overr... |
### Question:
LambdaServer implements HttpServer { @Override public ReadStream<ServerWebSocket> websocketStream() { return null; } LambdaServer(Vertx vertx, Context context, InputStream input, OutputStream output); @Override boolean isMetricsEnabled(); @Override ReadStream<HttpServerRequest> requestStream(); @Override ... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public MultiMap headers() { if (headers == null) { headers = MultiMap.caseInsensitiveMultiMap(); JsonObject requestHeaders = request.getJsonObject("headers"); if (requestHeaders != null) { for (Map.Entry<String, Object> entry : requestHeaders)... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String getHeader(String headerName) { return headers().get(headerName); } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Thro... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public MultiMap params() { if (params == null) { params = new CaseSensitiveMultiMapImpl(); JsonObject queryParams = request.getJsonObject("queryStringParameters"); if (queryParams != null) { for (Map.Entry<String, Object> entry : queryParams) ... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String getParam(String paramName) { return params().get(paramName); } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwabl... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public SocketAddress localAddress() { if (localAddress == null) { localAddress = new SocketAddress() { @Override public String host() { return localHost; } @Override public int port() { return localPort; } }; } return localAddress; } HttpServe... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public X509Certificate[] peerCertificateChain() throws SSLPeerUnverifiedException { return null; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHa... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String absoluteURI() { if (absoluteURI == null) { absoluteURI = uri(); } return absoluteURI; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptio... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public NetSocket netSocket() { return null; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Override HttpServ... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public HttpServerRequest setExpectMultipart(boolean expect) { checkEnded(); if (expect) { throw new java.lang.UnsupportedOperationException("Not supported yet."); } return this; } HttpServerRequestImpl(String localHost, int localPort, JsonObje... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public boolean isExpectMultipart() { return false; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Override H... |
### Question:
LambdaServer implements HttpServer { @Override public HttpServer websocketHandler(Handler<ServerWebSocket> handler) { this.websocketHandler = handler; return this; } LambdaServer(Vertx vertx, Context context, InputStream input, OutputStream output); @Override boolean isMetricsEnabled(); @Override ReadStre... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public HttpServerRequest uploadHandler(Handler<HttpServerFileUpload> uploadHandler) { checkEnded(); return this; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerReq... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public MultiMap formAttributes() { if (attributes == null) { attributes = MultiMap.caseInsensitiveMultiMap(); } return attributes; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Over... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public String getFormAttribute(String attributeName) { return formAttributes().get(attributeName); } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exception... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public ServerWebSocket upgrade() { throw new java.lang.UnsupportedOperationException("Not supported yet."); } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest ... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public boolean isEnded() { return ended; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Override HttpServerR... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public HttpServerRequest customFrameHandler(Handler<HttpFrame> handler) { return this; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Hand... |
### Question:
HttpServerRequestImpl implements HttpServerRequest { @Override public HttpConnection connection() { return null; } HttpServerRequestImpl(String localHost, int localPort, JsonObject request, HttpServerResponse response); @Override HttpServerRequest exceptionHandler(Handler<Throwable> handler); @Override Ht... |
### Question:
LambdaServer implements HttpServer { @Override public HttpServer listen() { processRequest(); return this; } LambdaServer(Vertx vertx, Context context, InputStream input, OutputStream output); @Override boolean isMetricsEnabled(); @Override ReadStream<HttpServerRequest> requestStream(); @Override HttpServ... |
### Question:
LambdaServer implements HttpServer { @Override public void close() { } LambdaServer(Vertx vertx, Context context, InputStream input, OutputStream output); @Override boolean isMetricsEnabled(); @Override ReadStream<HttpServerRequest> requestStream(); @Override HttpServer requestHandler(Handler<HttpServerRe... |
### Question:
HttpServerResponseImpl implements HttpServerResponse { @Override public boolean writeQueueFull() { checkWritten(); return false; } HttpServerResponseImpl(OutputStream output); @Override boolean writeQueueFull(); @Override HttpServerResponse exceptionHandler(Handler<Throwable> handler); @Override HttpServe... |
### Question:
DeviceTokenValidator implements ConstraintValidator<DeviceTokenCheck, Installation> { public static boolean isValidDeviceTokenForVariant(final String deviceToken, final VariantType type) { switch (type) { case IOS: case IOS_TOKEN: return IOS_DEVICE_TOKEN.matcher(deviceToken).matches(); case ANDROID: retur... |
### Question:
UnifiedPushMessage implements Serializable { public String toStrippedJsonString() { try { final Map<String, Object> json = new LinkedHashMap<>(); json.put("alert", this.message.getAlert()); json.put("priority", this.message.getPriority().toString()); if (this.getMessage().getBadge()>0) { json.put("badge",... |
### Question:
CommonUtils { public static Boolean isAscendingOrder(String sorting) { return "desc".equalsIgnoreCase(sorting) ? Boolean.FALSE : Boolean.TRUE; } private CommonUtils(); static Boolean isAscendingOrder(String sorting); static String removeDefaultHttpPorts(final String uri); }### Answer:
@Test public void ... |
### Question:
CommonUtils { public static String removeDefaultHttpPorts(final String uri) { URL url; try { url = new URL(uri); if (url.getPort() == url.getDefaultPort()) { String urlPort = ":" + url.getPort(); return url.toExternalForm().replace(urlPort, ""); } } catch (MalformedURLException e) { return null; } return ... |
### Question:
iOSApplicationUploadForm { @AssertTrue(message = "the provided certificate passphrase does not match with the uploaded certificate") public boolean isCertificatePassphraseValid() { try { PKCS12.validate(certificate, passphrase); return true; } catch (Exception e) { return false; } } iOSApplicationUploadFo... |
### Question:
InstallationManagementEndpoint { static LinkHeader getLinkHeader(Integer page, long totalPages, UriInfo uri) { LinkHeader header = new LinkHeader(); if (page != 0) { header.addLink(buildLink("prev", page - 1, uri)); header.addLink(buildLink("first", 0, uri)); } if (page < totalPages) { header.addLink(buil... |
### Question:
AndroidVariantEndpoint extends AbstractVariantEndpoint<AndroidVariant> { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response registerAndroidVariant( AndroidVariant androidVariant, @PathParam("pushAppID") String pushApplicationID, @Context UriInfo uriInfo) { Pu... |
### Question:
AndroidVariantEndpoint extends AbstractVariantEndpoint<AndroidVariant> { @GET @Produces(MediaType.APPLICATION_JSON) public Response listAllAndroidVariationsForPushApp(@PathParam("pushAppID") String pushApplicationID) { final PushApplication application = getSearch().findByPushApplicationIDForDeveloper(pus... |
### Question:
AndroidVariantEndpoint extends AbstractVariantEndpoint<AndroidVariant> { @PUT @Path("/{androidID}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateAndroidVariant( @PathParam("pushAppID") String pushApplicationId, @PathParam("androidID") String androidID, ... |
### Question:
WebPushVariantEndpoint extends AbstractVariantEndpoint<WebPushVariant> { @GET @Produces(MediaType.APPLICATION_JSON) public Response listAllWebPushVariationsForPushApp(@PathParam("pushAppID") String pushApplicationID) { final PushApplication application = getSearch().findByPushApplicationIDForDeveloper(pus... |
### Question:
WebPushVariantEndpoint extends AbstractVariantEndpoint<WebPushVariant> { @PUT @Path("/{webPushID}") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response updateWebPushVariant(@PathParam("pushAppID") String pushApplicationID, @PathParam("webPushID") String webPushID, W... |
### Question:
iOSTokenVariantEndpoint extends AbstractVariantEndpoint<iOSTokenVariant> { @POST @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public Response registeriOSVariant( iOSTokenVariant iOSVariant, @PathParam("pushAppID") String pushApplicationID, @Context UriInfo uriInfo) { PushApp... |
### Question:
ConfigurationUtils { public static String tryGetGlobalProperty(String key, String defaultValue) { try { String value = System.getenv(formatEnvironmentVariable(key)); if (value == null) { value = tryGetProperty(key, defaultValue); } return value; } catch (SecurityException e) { logger.error("Could not get ... |
### Question:
ConfigurationUtils { public static Integer tryGetGlobalIntegerProperty(String key, Integer defaultValue) { try { String value = System.getenv(formatEnvironmentVariable(key)); if (value == null) { return tryGetIntegerProperty(key, defaultValue); } else { return Integer.parseInt(value); } } catch (SecurityE... |
### Question:
ConfigurationUtils { public static String formatEnvironmentVariable(String key) { return key.toUpperCase().replaceAll("\\.", "_"); } private ConfigurationUtils(); static String formatEnvironmentVariable(String key); static String tryGetGlobalProperty(String key, String defaultValue); static String tryGet... |
### Question:
HttpBasicHelper { public static String[] extractUsernameAndPasswordFromBasicHeader(final HttpServletRequest request) { String username = ""; String password = ""; final String authorizationHeader = getAuthorizationHeader(request); if (authorizationHeader != null && isBasic(authorizationHeader)) { final St... |
### Question:
SenderConfigurationProvider { @Produces @ApplicationScoped @SenderType(VariantType.ANDROID) public SenderConfiguration produceAndroidConfiguration() { return loadConfigurationFor(VariantType.ANDROID, new SenderConfiguration(10, 1000)); } @Produces @ApplicationScoped @SenderType(VariantType.ANDROID) Sende... |
### Question:
TokenLoaderUtils { public static boolean isEmptyCriteria(final Criteria criteria) { return isEmpty(criteria.getAliases()) && isEmpty(criteria.getDeviceTypes()) && isEmpty(criteria.getCategories()); } private TokenLoaderUtils(); static Set<String> extractFCMTopics(final Criteria criteria, final String var... |
### Question:
TokenLoaderUtils { public static boolean isCategoryOnlyCriteria(final Criteria criteria) { return isEmpty(criteria.getAliases()) && isEmpty(criteria.getDeviceTypes()) && !isEmpty(criteria.getCategories()); } private TokenLoaderUtils(); static Set<String> extractFCMTopics(final Criteria criteria, final St... |
### Question:
TokenLoaderUtils { public static Set<String> extractFCMTopics(final Criteria criteria, final String variantID) { final Set<String> topics = new TreeSet<>(); if (isEmptyCriteria(criteria)) { topics.add(Constants.TOPIC_PREFIX + variantID); } else if (isCategoryOnlyCriteria(criteria)) { topics.addAll(criteri... |
### Question:
TokenLoaderUtils { public static boolean isFCMTopicRequest(final Criteria criteria) { return isEmptyCriteria(criteria) || isCategoryOnlyCriteria(criteria); } private TokenLoaderUtils(); static Set<String> extractFCMTopics(final Criteria criteria, final String variantID); static boolean isCategoryOnlyCrit... |
### Question:
NotificationRouter { @TransactionAttribute(TransactionAttributeType.REQUIRED) public void submit(PushApplication pushApplication, InternalUnifiedPushMessage message) { logger.debug("Processing send request with '{}' payload", message.getMessage()); final VariantMap variants = new VariantMap(); final List<... |
### Question:
LoginController { public String login(UserForm userForm) { System.out.println("LoginController.login " + userForm); try { if (userForm == null) { return "ERROR"; } else if (loginService.login(userForm)) { return "OK"; } else { return "KO"; } } catch (Exception e) { return "ERROR"; } } String login(UserFo... |
### Question:
LoginService { public boolean login(UserForm userForm) { System.out.println("LoginService.login " + userForm); checkForm(userForm); String username = userForm.getUsername(); if (usersLogged.contains(username)) { throw new LoginException(username + " already logged"); } boolean login = loginRepository.logi... |
### Question:
LoginController { public void logout(UserForm userForm) { System.out.println("LoginController.logout " + userForm); loginService.logout(userForm); } String login(UserForm userForm); void logout(UserForm userForm); public LoginService loginService; }### Answer:
@Test public void testLogout() { loginContro... |
### Question:
MapProcessor extends MRTask implements LogicalIOProcessor { public MapProcessor(){ super(true); } MapProcessor(); @Override void initialize(TezProcessorContext processorContext); @Override void handleEvents(List<Event> processorEvents); void close(); @Override void run(Map<String, LogicalInput> inputs,
... |
### Question:
SimpleFetchedInputAllocator implements FetchedInputAllocator,
FetchedInputCallback { @Override public synchronized FetchedInput allocate(long actualSize, long compressedSize, InputAttemptIdentifier inputAttemptIdentifier) throws IOException { if (actualSize > maxSingleShuffleLimit || this.usedMemory +... |
### Question:
ShuffleInputEventHandlerImpl implements ShuffleEventHandler { @Override public void handleEvents(List<Event> events) throws IOException { for (Event event : events) { handleEvent(event); } } ShuffleInputEventHandlerImpl(TezInputContext inputContext,
ShuffleManager shuffleManager,
FetchedInputA... |
### Question:
ShuffledMergedInputConfiguration { public static Builder newBuilder(String keyClass, String valueClass) { return new Builder(keyClass, valueClass); } @InterfaceAudience.Private @VisibleForTesting ShuffledMergedInputConfiguration(); private ShuffledMergedInputConfiguration(Configuration conf, boolean use... |
### Question:
OnFileUnorderedKVOutputConfiguration { public static Builder newBuilder(String keyClass, String valClass) { return new Builder(keyClass, valClass); } @InterfaceAudience.Private @VisibleForTesting OnFileUnorderedKVOutputConfiguration(); private OnFileUnorderedKVOutputConfiguration(Configuration conf); by... |
### Question:
UnorderedUnpartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBaseConf { public static Builder newBuilder(String keyClassName, String valueClassName) { return new Builder(keyClassName, valueClassName); } private UnorderedUnpartitionedKVEdgeConfigurer(
OnFileUnorderedKVOutputConfiguration outpu... |
### Question:
OrderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBaseConf { public static Builder newBuilder(String keyClassName, String valueClassName, String partitionerClassName, Configuration partitionerConf) { return new Builder(keyClassName, valueClassName, partitionerClassName, partitionerConf); } pr... |
### Question:
OnFileSortedOutputConfiguration { public static Builder newBuilder(String keyClass, String valueClass, String partitionerClassName, Configuration partitionerConf) { return new Builder(keyClass, valueClass, partitionerClassName, partitionerConf); } @InterfaceAudience.Private @VisibleForTesting OnFileSorte... |
### Question:
UnorderedPartitionedKVEdgeConfigurer extends HadoopKeyValuesBasedBaseConf { public static Builder newBuilder(String keyClassName, String valueClassName, String partitionerClassName, Configuration partitionerConf) { return new Builder(keyClassName, valueClassName, partitionerClassName, partitionerConf); } ... |
### Question:
ShuffledUnorderedKVInputConfiguration { public static Builder newBuilder(String keyClass, String valueClass) { return new Builder(keyClass, valueClass); } @InterfaceAudience.Private @VisibleForTesting ShuffledUnorderedKVInputConfiguration(); private ShuffledUnorderedKVInputConfiguration(Configuration co... |
### Question:
TezUtils { @Private public static String cleanVertexName(String vertexName) { return sanitizeString(vertexName).substring(0, vertexName.length() > MAX_VERTEX_NAME_LENGTH ? MAX_VERTEX_NAME_LENGTH : vertexName.length()); } static void addUserSpecifiedTezConfiguration(Configuration conf); static ByteString ... |
### Question:
TezUtils { public static byte[] toByteArray(BitSet bits) { if (bits == null) { return null; } byte[] bytes = new byte[bits.length() / 8 + 1]; for (int i = 0; i < bits.length(); i++) { if (bits.get(i)) { bytes[(bytes.length) - (i / 8) - 1] |= 1 << (i % 8); } } return bytes; } static void addUserSpecifiedT... |
### Question:
TokenCache { @InterfaceAudience.Private public static void mergeBinaryTokens(Credentials creds, Configuration conf, String tokenFilePath) throws IOException { if (tokenFilePath == null || tokenFilePath.isEmpty()) { throw new RuntimeException("Invalid file path provided" + ", tokenFilePath=" + tokenFilePat... |
### Question:
TezCommonUtils { public static Path getTezBaseStagingPath(Configuration conf) { String stagingDirStr = conf.get(TezConfiguration.TEZ_AM_STAGING_DIR, TezConfiguration.TEZ_AM_STAGING_DIR_DEFAULT); Path baseStagingDir; try { Path p = new Path(stagingDirStr); FileSystem fs = p.getFileSystem(conf); if (!fs.exi... |
### Question:
TezCommonUtils { @Private public static Path createTezSystemStagingPath(Configuration conf, String strAppId) { Path baseStagingPath = getTezBaseStagingPath(conf); Path tezStagingDir; try { tezStagingDir = new Path(baseStagingPath, TEZ_SYSTEM_SUB_DIR); FileSystem fs = tezStagingDir.getFileSystem(conf); tez... |
### Question:
TezCommonUtils { @Private public static Path getTezSystemStagingPath(Configuration conf, String strAppId) { Path baseStagingPath = getTezBaseStagingPath(conf); Path tezStagingDir; tezStagingDir = new Path(baseStagingPath, TEZ_SYSTEM_SUB_DIR); tezStagingDir = new Path(tezStagingDir, strAppId); return tezSt... |
### Question:
TezClientUtils { public static String maybeAddDefaultMemoryJavaOpts(String javaOpts, Resource resource, double maxHeapFactor) { if ((javaOpts != null && !javaOpts.isEmpty() && (javaOpts.contains("-Xmx") || javaOpts.contains("-Xms"))) || (resource.getMemory() <= 0)) { return javaOpts; } if (maxHeapFactor <... |
### Question:
TezClientUtils { static void maybeAddDefaultLoggingJavaOpts(String logLevel, List<String> vargs) { if (vargs != null && !vargs.isEmpty()) { for (String arg : vargs) { if (arg.contains(TezConfiguration.TEZ_ROOT_LOGGER_NAME)) { return ; } } } TezClientUtils.addLog4jSystemProperties(logLevel, vargs); } stat... |
### Question:
InputReadyTracker implements InputReadyCallback { public Input waitForAnyInputReady(Collection<Input> inputs) throws InterruptedException { Preconditions.checkArgument(inputs != null && inputs.size() > 0, "At least one input should be specified"); InputReadyMonitor inputReadyMonitor = new InputReadyMonito... |
### Question:
AMNodeMap extends AbstractService implements
EventHandler<AMNodeEvent> { public void handle(AMNodeEvent rEvent) { NodeId nodeId = rEvent.getNodeId(); switch (rEvent.getType()) { case N_NODE_WAS_BLACKLISTED: addToBlackList(nodeId); computeIgnoreBlacklisting(); break; case N_NODE_COUNT_UPDATED: AMNodeEv... |
### Question:
VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
EventHandler<VertexEvent> { @Override public List<String> getDiagnostics() { readLock.lock(); try { return diagnostics; } finally { readLock.unlock(); } } VertexImpl(TezVertexID vertexId, VertexPlan vertexPlan,
String vertexName, Configurati... |
### Question:
VertexImpl implements org.apache.tez.dag.app.dag.Vertex,
EventHandler<VertexEvent> { @Nullable @Private @VisibleForTesting public OutputCommitter getOutputCommitter(String outputName) { if (this.outputCommitters != null) { return outputCommitters.get(outputName); } return null; } VertexImpl(TezVertexID ... |
### Question:
TaskImpl implements Task, EventHandler<TaskEvent> { @Override public List<TezEvent> getTaskAttemptTezEvents(TezTaskAttemptID attemptID, int fromEventId, int maxEvents) { List<TezEvent> events = EMPTY_TASK_ATTEMPT_TEZ_EVENTS; readLock.lock(); if (!attempts.containsKey(attemptID)) { throw new TezUncheckedEx... |
### Question:
TaskImpl implements Task, EventHandler<TaskEvent> { @Override public float getProgress() { readLock.lock(); try { TaskAttempt bestAttempt = selectBestAttempt(); if (bestAttempt == null) { return 0f; } return bestAttempt.getProgress(); } finally { readLock.unlock(); } } TaskImpl(TezVertexID vertexId, int t... |
### Question:
TaskImpl implements Task, EventHandler<TaskEvent> { @Override public void handle(TaskEvent event) { if (LOG.isDebugEnabled()) { LOG.debug("Processing TaskEvent " + event.getTaskID() + " of type " + event.getType() + " while in state " + getInternalState() + ". Event: " + event); } try { writeLock.lock(); ... |
### Question:
DAGImpl implements org.apache.tez.dag.app.dag.DAG,
EventHandler<DAGEvent> { @Override public int getTotalVertices() { readLock.lock(); try { return numVertices; } finally { readLock.unlock(); } } DAGImpl(TezDAGID dagId,
Configuration conf,
DAGPlan jobPlan,
EventHandler eventHandler,
... |
### Question:
VertexStatusBuilder extends VertexStatus { @VisibleForTesting static VertexStatusStateProto getProtoState(VertexState state) { switch(state) { case NEW: return VertexStatusStateProto.VERTEX_NEW; case INITIALIZING: return VertexStatusStateProto.VERTEX_INITIALIZING; case RECOVERING: return VertexStatusState... |
### Question:
JavaProfilerOptions { public String getProfilerOptions(String jvmOpts, String vertexName, int taskIdx) { jvmOpts = (jvmOpts == null) ? "" : jvmOpts; vertexName = vertexName.replaceAll(" ", ""); String result = jvmProfilingOpts.replaceAll("__VERTEX_NAME__", vertexName) .replaceAll("__TASK_INDEX__", Integer... |
### Question:
EnvironmentUpdateUtils { public static void put(String key, String value){ Map<String, String> environment = new HashMap<String, String>(System.getenv()); environment.put(key, value); updateEnvironment(environment); } static void put(String key, String value); static void putAll(Map<String, String> addit... |
### Question:
ATSHistoryLoggingService extends HistoryLoggingService { public void handle(DAGHistoryEvent event) { eventQueue.add(event); } ATSHistoryLoggingService(); @Override void serviceInit(Configuration conf); @Override void serviceStart(); @Override void serviceStop(); void handle(DAGHistoryEvent event); }### A... |
### Question:
MRHelpers { public static Configuration getBaseMRConfiguration(Configuration conf) { return getBaseJobConf(conf); } @LimitedPrivate("Hive, Pig") @Unstable static void translateVertexConfToTez(Configuration conf); @SuppressWarnings({ "rawtypes", "unchecked" }) @Private static org.apache.hadoop.mapreduce.I... |
### Question:
MRHelpers { public static String getMRAMJavaOpts(Configuration conf) { String mrAppMasterAdminOptions = conf.get( MRJobConfig.MR_AM_ADMIN_COMMAND_OPTS, MRJobConfig.DEFAULT_MR_AM_ADMIN_COMMAND_OPTS); String mrAppMasterUserOptions = conf.get(MRJobConfig.MR_AM_COMMAND_OPTS, MRJobConfig.DEFAULT_MR_AM_COMMAND_... |
### Question:
LoggerFactory { public synchronized void useCommonsLogging() { setImplementation(JakartaCommonsLoggingImpl.class); } Logger getLog(Class<?> aClass); Logger getLog(String logger); synchronized void useCustomLogging(Class<? extends Logger> clazz); synchronized void useSlf4jLogging(); synchronized void useC... |
### Question:
LoggerFactory { public synchronized void useJdkLogging() { setImplementation(Jdk14LoggingImpl.class); } Logger getLog(Class<?> aClass); Logger getLog(String logger); synchronized void useCustomLogging(Class<? extends Logger> clazz); synchronized void useSlf4jLogging(); synchronized void useCommonsLogging... |
### Question:
LoggerFactory { public synchronized void useNoLogging() { setImplementation(NoLoggingImpl.class); } Logger getLog(Class<?> aClass); Logger getLog(String logger); synchronized void useCustomLogging(Class<? extends Logger> clazz); synchronized void useSlf4jLogging(); synchronized void useCommonsLogging(); ... |
### Question:
StringPrimitiveOperand implements PrimitiveOperand { @Override public String getValue() { return value; } StringPrimitiveOperand(@NonNull String value); @Override String getValue(); @Override String getType(); }### Answer:
@Test public void operand_should_auto_unwrap_quote() { StringPrimitiveOperand oper... |
### Question:
AntlrUtils { String errorLine(String errorMessage, int lineNumber) { int startIndex = 0; int endIndex = 0; for (int i = 0; i < lineNumber; i++) { int index = errorMessage.indexOf('\n', endIndex + 1); if (i > 0) { startIndex = endIndex + 1; } if (index >= 0) { endIndex = index; } else { endIndex = errorMes... |
### Question:
CoffeeHouseApp implements Terminal { static void applySystemProperties(final Map<String, String> opts) { opts.forEach((key, value) -> { if (key.startsWith("-D")) System.setProperty(key.substring(2), value); }); } CoffeeHouseApp(final ActorSystem system); static void main(final String[] args); }### Answer... |
### Question:
Barista extends AbstractLoggingActor { public static Props props(FiniteDuration prepareCoffeeDuration) { return Props.create(Barista.class, () -> new Barista(prepareCoffeeDuration)); } private Barista(FiniteDuration prepareCoffeeDuration); @Override Receive createReceive(); static Props props(FiniteDurat... |
### Question:
CoffeeHouseApp implements Terminal { void createGuest(int count, Coffee coffee, int maxCoffeeCount) { for (int i = 0; i < count; i++) { coffeeHouse.tell(new CoffeeHouse.CreateGuest(coffee), ActorRef.noSender()); } } CoffeeHouseApp(final ActorSystem system); static void main(final String[] args); }### Ans... |
### Question:
CoffeeHouseApp implements Terminal { static Map<String, String> argsToOpts(final List<String> args) { final Map<String, String> opts = new HashMap<>(); for (final String arg : args) { final Matcher matcher = optPattern.matcher(arg); if (matcher.matches()) opts.put(matcher.group(1), matcher.group(2)); } re... |
### Question:
Waiter extends AbstractLoggingActor { public static Props props(ActorRef barista) { return Props.create(Waiter.class, () -> new Waiter(barista)); } Waiter(ActorRef barista); @Override Receive createReceive(); static Props props(ActorRef barista); }### Answer:
@Test public void sendingServeCoffeeShouldRes... |
### Question:
CoffeeHouse extends AbstractLoggingActor { static Props props() { return Props.create(CoffeeHouse.class, CoffeeHouse::new); } CoffeeHouse(); @Override Receive createReceive(); }### Answer:
@Test public void shouldLogMessageWhenCreated() { new JavaTestKit(system) {{ interceptDebugLogMessage(this, ".*[Oo]p... |
### Question:
Waiter extends AbstractLoggingActor { static Props props() { return Props.create(Waiter.class, Waiter::new); } private Waiter(); @Override Receive createReceive(); }### Answer:
@Test public void sendingServeCoffeeShouldResultInCoffeeServedResponse() { new JavaTestKit(system) {{ ActorRef waiter = system.... |
### Question:
Guest extends AbstractLoggingActor { static Props props( final ActorRef waiter, final Coffee favoriteCoffee, FiniteDuration finishCoffeeDuration) { return Props.create(Guest.class, () -> new Guest(waiter, favoriteCoffee, finishCoffeeDuration)); } Guest(ActorRef waiter, Coffee favoriteCoffee, FiniteDuratio... |
### Question:
JsonUtil { public static MessageType parseFrame(final String json) { return fromJson(json, MessageType.class); } private JsonUtil(); static T fromJson(final String json, final Class<T> type); static String toJson(final Object obj); static MessageType parseFrame(final String json); }### Answer:
@Test pub... |
### Question:
JpaDataStore implements DataStore { @Override public Set<Ack> removeAcknowledged(final String uaid, final Set<Ack> acked) { final JpaOperation<Set<Ack>> removeAck = new JpaOperation<Set<Ack>>() { @Override public Set<Ack> perform(final EntityManager em) { final List<String> channelIds = new ArrayList<Stri... |
### Question:
JpaDataStore implements DataStore { @Override public Set<Ack> getUnacknowledged(final String uaid) { final JpaOperation<Set<Ack>> getUnacks = new JpaOperation<Set<Ack>>() { @Override public Set<Ack> perform(final EntityManager em) { final UserAgentDTO userAgent = em.find(UserAgentDTO.class, uaid); if (use... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.