コード例 #1
0
 private static void maybeFillLinks(TaskConfig task) {
   if (task.getTaskLinksSize() == 0) {
     ImmutableMap.Builder<String, String> links = ImmutableMap.builder();
     if (task.getRequestedPorts().contains("health")) {
       links.put("health", "http://%host%:%port:health%");
     }
     if (task.getRequestedPorts().contains("http")) {
       links.put("http", "http://%host%:%port:http%");
     }
     task.setTaskLinks(links.build());
   }
 }
コード例 #2
0
 private static void maybeFillLinks(TaskConfig task) {
   if (task.getTaskLinksSize() == 0) {
     ImmutableMap.Builder<String, String> links = ImmutableMap.builder();
     for (IResource resource : ResourceManager.getTaskResources(ITaskConfig.build(task), PORTS)) {
       if (resource.getNamedPort().equals("health")) {
         links.put("health", "http://%host%:%port:health%");
       } else if (resource.getNamedPort().equals("http")) {
         links.put("http", "http://%host%:%port:http%");
       }
     }
     task.setTaskLinks(links.build());
   }
 }