id int32 0 165k | repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 |
|---|---|---|---|---|---|---|---|---|---|---|---|
126,000 | google/gson | codegen/src/main/java/com/google/gson/codegen/JavaWriter.java | JavaWriter.modifiers | private void modifiers(int modifiers) throws IOException {
if ((modifiers & Modifier.PUBLIC) != 0) {
out.write("public ");
}
if ((modifiers & Modifier.PRIVATE) != 0) {
out.write("private ");
}
if ((modifiers & Modifier.PROTECTED) != 0) {
out.write("protected ");
}
if ((modi... | java | private void modifiers(int modifiers) throws IOException {
if ((modifiers & Modifier.PUBLIC) != 0) {
out.write("public ");
}
if ((modifiers & Modifier.PRIVATE) != 0) {
out.write("private ");
}
if ((modifiers & Modifier.PROTECTED) != 0) {
out.write("protected ");
}
if ((modi... | [
"private",
"void",
"modifiers",
"(",
"int",
"modifiers",
")",
"throws",
"IOException",
"{",
"if",
"(",
"(",
"modifiers",
"&",
"Modifier",
".",
"PUBLIC",
")",
"!=",
"0",
")",
"{",
"out",
".",
"write",
"(",
"\"public \"",
")",
";",
"}",
"if",
"(",
"(",... | Emit modifier names. | [
"Emit",
"modifier",
"names",
"."
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/codegen/src/main/java/com/google/gson/codegen/JavaWriter.java#L382-L410 |
126,001 | google/gson | gson/src/main/java/com/google/gson/JsonArray.java | JsonArray.add | public void add(Boolean bool) {
elements.add(bool == null ? JsonNull.INSTANCE : new JsonPrimitive(bool));
} | java | public void add(Boolean bool) {
elements.add(bool == null ? JsonNull.INSTANCE : new JsonPrimitive(bool));
} | [
"public",
"void",
"add",
"(",
"Boolean",
"bool",
")",
"{",
"elements",
".",
"add",
"(",
"bool",
"==",
"null",
"?",
"JsonNull",
".",
"INSTANCE",
":",
"new",
"JsonPrimitive",
"(",
"bool",
")",
")",
";",
"}"
] | Adds the specified boolean to self.
@param bool the boolean that needs to be added to the array. | [
"Adds",
"the",
"specified",
"boolean",
"to",
"self",
"."
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonArray.java#L68-L70 |
126,002 | google/gson | gson/src/main/java/com/google/gson/JsonArray.java | JsonArray.add | public void add(Character character) {
elements.add(character == null ? JsonNull.INSTANCE : new JsonPrimitive(character));
} | java | public void add(Character character) {
elements.add(character == null ? JsonNull.INSTANCE : new JsonPrimitive(character));
} | [
"public",
"void",
"add",
"(",
"Character",
"character",
")",
"{",
"elements",
".",
"add",
"(",
"character",
"==",
"null",
"?",
"JsonNull",
".",
"INSTANCE",
":",
"new",
"JsonPrimitive",
"(",
"character",
")",
")",
";",
"}"
] | Adds the specified character to self.
@param character the character that needs to be added to the array. | [
"Adds",
"the",
"specified",
"character",
"to",
"self",
"."
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonArray.java#L77-L79 |
126,003 | google/gson | gson/src/main/java/com/google/gson/JsonArray.java | JsonArray.add | public void add(Number number) {
elements.add(number == null ? JsonNull.INSTANCE : new JsonPrimitive(number));
} | java | public void add(Number number) {
elements.add(number == null ? JsonNull.INSTANCE : new JsonPrimitive(number));
} | [
"public",
"void",
"add",
"(",
"Number",
"number",
")",
"{",
"elements",
".",
"add",
"(",
"number",
"==",
"null",
"?",
"JsonNull",
".",
"INSTANCE",
":",
"new",
"JsonPrimitive",
"(",
"number",
")",
")",
";",
"}"
] | Adds the specified number to self.
@param number the number that needs to be added to the array. | [
"Adds",
"the",
"specified",
"number",
"to",
"self",
"."
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonArray.java#L86-L88 |
126,004 | google/gson | gson/src/main/java/com/google/gson/JsonArray.java | JsonArray.add | public void add(String string) {
elements.add(string == null ? JsonNull.INSTANCE : new JsonPrimitive(string));
} | java | public void add(String string) {
elements.add(string == null ? JsonNull.INSTANCE : new JsonPrimitive(string));
} | [
"public",
"void",
"add",
"(",
"String",
"string",
")",
"{",
"elements",
".",
"add",
"(",
"string",
"==",
"null",
"?",
"JsonNull",
".",
"INSTANCE",
":",
"new",
"JsonPrimitive",
"(",
"string",
")",
")",
";",
"}"
] | Adds the specified string to self.
@param string the string that needs to be added to the array. | [
"Adds",
"the",
"specified",
"string",
"to",
"self",
"."
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonArray.java#L95-L97 |
126,005 | google/gson | gson/src/main/java/com/google/gson/JsonArray.java | JsonArray.add | public void add(JsonElement element) {
if (element == null) {
element = JsonNull.INSTANCE;
}
elements.add(element);
} | java | public void add(JsonElement element) {
if (element == null) {
element = JsonNull.INSTANCE;
}
elements.add(element);
} | [
"public",
"void",
"add",
"(",
"JsonElement",
"element",
")",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"element",
"=",
"JsonNull",
".",
"INSTANCE",
";",
"}",
"elements",
".",
"add",
"(",
"element",
")",
";",
"}"
] | Adds the specified element to self.
@param element the element that needs to be added to the array. | [
"Adds",
"the",
"specified",
"element",
"to",
"self",
"."
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/JsonArray.java#L104-L109 |
126,006 | google/gson | gson/src/main/java/com/google/gson/internal/JavaVersion.java | JavaVersion.parseDotted | private static int parseDotted(String javaVersion) {
try {
String[] parts = javaVersion.split("[._]");
int firstVer = Integer.parseInt(parts[0]);
if (firstVer == 1 && parts.length > 1) {
return Integer.parseInt(parts[1]);
} else {
return firstVer;
}
} catch (NumberF... | java | private static int parseDotted(String javaVersion) {
try {
String[] parts = javaVersion.split("[._]");
int firstVer = Integer.parseInt(parts[0]);
if (firstVer == 1 && parts.length > 1) {
return Integer.parseInt(parts[1]);
} else {
return firstVer;
}
} catch (NumberF... | [
"private",
"static",
"int",
"parseDotted",
"(",
"String",
"javaVersion",
")",
"{",
"try",
"{",
"String",
"[",
"]",
"parts",
"=",
"javaVersion",
".",
"split",
"(",
"\"[._]\"",
")",
";",
"int",
"firstVer",
"=",
"Integer",
".",
"parseInt",
"(",
"parts",
"["... | Parses both legacy 1.8 style and newer 9.0.4 style | [
"Parses",
"both",
"legacy",
"1",
".",
"8",
"style",
"and",
"newer",
"9",
".",
"0",
".",
"4",
"style"
] | 63ee47cb642c8018e5cddd639aa2be143220ad4b | https://github.com/google/gson/blob/63ee47cb642c8018e5cddd639aa2be143220ad4b/gson/src/main/java/com/google/gson/internal/JavaVersion.java#L46-L58 |
126,007 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/AbstractAzToRegionMapper.java | AbstractAzToRegionMapper.parseAzToGetRegion | protected String parseAzToGetRegion(String availabilityZone) {
// Here we see that whether the availability zone is following a pattern like <region><single letter>
// If it is then we take ignore the last letter and check if the remaining part is actually a known remote
// region. If yes, then ... | java | protected String parseAzToGetRegion(String availabilityZone) {
// Here we see that whether the availability zone is following a pattern like <region><single letter>
// If it is then we take ignore the last letter and check if the remaining part is actually a known remote
// region. If yes, then ... | [
"protected",
"String",
"parseAzToGetRegion",
"(",
"String",
"availabilityZone",
")",
"{",
"// Here we see that whether the availability zone is following a pattern like <region><single letter>",
"// If it is then we take ignore the last letter and check if the remaining part is actually a known re... | Tries to determine what region we're in, based on the provided availability zone.
@param availabilityZone the availability zone to inspect
@return the region, if available; null otherwise | [
"Tries",
"to",
"determine",
"what",
"region",
"we",
"re",
"in",
"based",
"on",
"the",
"provided",
"availability",
"zone",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/AbstractAzToRegionMapper.java#L117-L128 |
126,008 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.fetchRegistry | private boolean fetchRegistry() {
boolean success;
Stopwatch tracer = fetchRegistryTimer.start();
try {
// If the delta is disabled or if it is the first time, get all applications
if (serverConfig.shouldDisableDeltaForRemoteRegions()
|| (getApplicati... | java | private boolean fetchRegistry() {
boolean success;
Stopwatch tracer = fetchRegistryTimer.start();
try {
// If the delta is disabled or if it is the first time, get all applications
if (serverConfig.shouldDisableDeltaForRemoteRegions()
|| (getApplicati... | [
"private",
"boolean",
"fetchRegistry",
"(",
")",
"{",
"boolean",
"success",
";",
"Stopwatch",
"tracer",
"=",
"fetchRegistryTimer",
".",
"start",
"(",
")",
";",
"try",
"{",
"// If the delta is disabled or if it is the first time, get all applications",
"if",
"(",
"server... | Fetch the registry information from the remote region.
@return true, if the fetch was successful, false otherwise. | [
"Fetch",
"the",
"registry",
"information",
"from",
"the",
"remote",
"region",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L217-L243 |
126,009 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.updateDelta | private void updateDelta(Applications delta) {
int deltaCount = 0;
for (Application app : delta.getRegisteredApplications()) {
for (InstanceInfo instance : app.getInstances()) {
++deltaCount;
if (ActionType.ADDED.equals(instance.getActionType())) {
... | java | private void updateDelta(Applications delta) {
int deltaCount = 0;
for (Application app : delta.getRegisteredApplications()) {
for (InstanceInfo instance : app.getInstances()) {
++deltaCount;
if (ActionType.ADDED.equals(instance.getActionType())) {
... | [
"private",
"void",
"updateDelta",
"(",
"Applications",
"delta",
")",
"{",
"int",
"deltaCount",
"=",
"0",
";",
"for",
"(",
"Application",
"app",
":",
"delta",
".",
"getRegisteredApplications",
"(",
")",
")",
"{",
"for",
"(",
"InstanceInfo",
"instance",
":",
... | Updates the delta information fetches from the eureka server into the
local cache.
@param delta
the delta information received from eureka server in the last
poll cycle. | [
"Updates",
"the",
"delta",
"information",
"fetches",
"from",
"the",
"eureka",
"server",
"into",
"the",
"local",
"cache",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L292-L336 |
126,010 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.closeResponse | private void closeResponse(ClientResponse response) {
if (response != null) {
try {
response.close();
} catch (Throwable th) {
logger.error("Cannot release response resource :", th);
}
}
} | java | private void closeResponse(ClientResponse response) {
if (response != null) {
try {
response.close();
} catch (Throwable th) {
logger.error("Cannot release response resource :", th);
}
}
} | [
"private",
"void",
"closeResponse",
"(",
"ClientResponse",
"response",
")",
"{",
"if",
"(",
"response",
"!=",
"null",
")",
"{",
"try",
"{",
"response",
".",
"close",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"th",
")",
"{",
"logger",
".",
"error",... | Close HTTP response object and its respective resources.
@param response
the HttpResponse object. | [
"Close",
"HTTP",
"response",
"object",
"and",
"its",
"respective",
"resources",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L344-L352 |
126,011 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.storeFullRegistry | public boolean storeFullRegistry() {
long currentGeneration = fetchRegistryGeneration.get();
Applications apps = fetchRemoteRegistry(false);
if (apps == null) {
logger.error("The application is null for some reason. Not storing this information");
} else if (fetchRegistryGene... | java | public boolean storeFullRegistry() {
long currentGeneration = fetchRegistryGeneration.get();
Applications apps = fetchRemoteRegistry(false);
if (apps == null) {
logger.error("The application is null for some reason. Not storing this information");
} else if (fetchRegistryGene... | [
"public",
"boolean",
"storeFullRegistry",
"(",
")",
"{",
"long",
"currentGeneration",
"=",
"fetchRegistryGeneration",
".",
"get",
"(",
")",
";",
"Applications",
"apps",
"=",
"fetchRemoteRegistry",
"(",
"false",
")",
";",
"if",
"(",
"apps",
"==",
"null",
")",
... | Gets the full registry information from the eureka server and stores it
locally.
@return the full registry information. | [
"Gets",
"the",
"full",
"registry",
"information",
"from",
"the",
"eureka",
"server",
"and",
"stores",
"it",
"locally",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L360-L374 |
126,012 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.fetchRemoteRegistry | private Applications fetchRemoteRegistry(boolean delta) {
logger.info("Getting instance registry info from the eureka server : {} , delta : {}", this.remoteRegionURL, delta);
if (shouldUseExperimentalTransport()) {
try {
EurekaHttpResponse<Applications> httpResponse = delta ... | java | private Applications fetchRemoteRegistry(boolean delta) {
logger.info("Getting instance registry info from the eureka server : {} , delta : {}", this.remoteRegionURL, delta);
if (shouldUseExperimentalTransport()) {
try {
EurekaHttpResponse<Applications> httpResponse = delta ... | [
"private",
"Applications",
"fetchRemoteRegistry",
"(",
"boolean",
"delta",
")",
"{",
"logger",
".",
"info",
"(",
"\"Getting instance registry info from the eureka server : {} , delta : {}\"",
",",
"this",
".",
"remoteRegionURL",
",",
"delta",
")",
";",
"if",
"(",
"shoul... | Fetch registry information from the remote region.
@param delta - true, if the fetch needs to get deltas, false otherwise
@return - response which has information about the data. | [
"Fetch",
"registry",
"information",
"from",
"the",
"remote",
"region",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L381-L417 |
126,013 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.reconcileAndLogDifference | private boolean reconcileAndLogDifference(Applications delta, String reconcileHashCode) throws Throwable {
logger.warn("The Reconcile hashcodes do not match, client : {}, server : {}. Getting the full registry",
reconcileHashCode, delta.getAppsHashCode());
long currentGeneration = fetch... | java | private boolean reconcileAndLogDifference(Applications delta, String reconcileHashCode) throws Throwable {
logger.warn("The Reconcile hashcodes do not match, client : {}, server : {}. Getting the full registry",
reconcileHashCode, delta.getAppsHashCode());
long currentGeneration = fetch... | [
"private",
"boolean",
"reconcileAndLogDifference",
"(",
"Applications",
"delta",
",",
"String",
"reconcileHashCode",
")",
"throws",
"Throwable",
"{",
"logger",
".",
"warn",
"(",
"\"The Reconcile hashcodes do not match, client : {}, server : {}. Getting the full registry\"",
",",
... | Reconciles the delta information fetched to see if the hashcodes match.
@param delta - the delta information fetched previously for reconciliation.
@param reconcileHashCode - the hashcode for comparison.
@return - response
@throws Throwable | [
"Reconciles",
"the",
"delta",
"information",
"fetched",
"to",
"see",
"if",
"the",
"hashcodes",
"match",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L427-L450 |
126,014 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java | RemoteRegionRegistry.logTotalInstances | private void logTotalInstances() {
int totInstances = 0;
for (Application application : getApplications().getRegisteredApplications()) {
totInstances += application.getInstancesAsIsFromEureka().size();
}
logger.debug("The total number of all instances in the client now is {}"... | java | private void logTotalInstances() {
int totInstances = 0;
for (Application application : getApplications().getRegisteredApplications()) {
totInstances += application.getInstancesAsIsFromEureka().size();
}
logger.debug("The total number of all instances in the client now is {}"... | [
"private",
"void",
"logTotalInstances",
"(",
")",
"{",
"int",
"totInstances",
"=",
"0",
";",
"for",
"(",
"Application",
"application",
":",
"getApplications",
"(",
")",
".",
"getRegisteredApplications",
"(",
")",
")",
"{",
"totInstances",
"+=",
"application",
... | Logs the total number of non-filtered instances stored locally. | [
"Logs",
"the",
"total",
"number",
"of",
"non",
"-",
"filtered",
"instances",
"stored",
"locally",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/RemoteRegionRegistry.java#L455-L461 |
126,015 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java | EndpointUtils.getDiscoveryServiceUrls | public static List<String> getDiscoveryServiceUrls(EurekaClientConfig clientConfig, String zone, ServiceUrlRandomizer randomizer) {
boolean shouldUseDns = clientConfig.shouldUseDnsForFetchingServiceUrls();
if (shouldUseDns) {
return getServiceUrlsFromDNS(clientConfig, zone, clientConfig.shou... | java | public static List<String> getDiscoveryServiceUrls(EurekaClientConfig clientConfig, String zone, ServiceUrlRandomizer randomizer) {
boolean shouldUseDns = clientConfig.shouldUseDnsForFetchingServiceUrls();
if (shouldUseDns) {
return getServiceUrlsFromDNS(clientConfig, zone, clientConfig.shou... | [
"public",
"static",
"List",
"<",
"String",
">",
"getDiscoveryServiceUrls",
"(",
"EurekaClientConfig",
"clientConfig",
",",
"String",
"zone",
",",
"ServiceUrlRandomizer",
"randomizer",
")",
"{",
"boolean",
"shouldUseDns",
"=",
"clientConfig",
".",
"shouldUseDnsForFetchin... | Get the list of all eureka service urls for the eureka client to talk to.
@param clientConfig the clientConfig to use
@param zone the zone in which the client resides
@param randomizer a randomizer to randomized returned urls, if loading from dns
@return The list of all eureka service urls for the eureka client to ta... | [
"Get",
"the",
"list",
"of",
"all",
"eureka",
"service",
"urls",
"for",
"the",
"eureka",
"client",
"to",
"talk",
"to",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java#L74-L80 |
126,016 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java | EndpointUtils.getRegion | public static String getRegion(EurekaClientConfig clientConfig) {
String region = clientConfig.getRegion();
if (region == null) {
region = DEFAULT_REGION;
}
region = region.trim().toLowerCase();
return region;
} | java | public static String getRegion(EurekaClientConfig clientConfig) {
String region = clientConfig.getRegion();
if (region == null) {
region = DEFAULT_REGION;
}
region = region.trim().toLowerCase();
return region;
} | [
"public",
"static",
"String",
"getRegion",
"(",
"EurekaClientConfig",
"clientConfig",
")",
"{",
"String",
"region",
"=",
"clientConfig",
".",
"getRegion",
"(",
")",
";",
"if",
"(",
"region",
"==",
"null",
")",
"{",
"region",
"=",
"DEFAULT_REGION",
";",
"}",
... | Get the region that this particular instance is in.
@return - The region in which the particular instance belongs to. | [
"Get",
"the",
"region",
"that",
"this",
"particular",
"instance",
"is",
"in",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java#L356-L363 |
126,017 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java | EndpointUtils.getZoneOffset | private static int getZoneOffset(String myZone, boolean preferSameZone, String[] availZones) {
for (int i = 0; i < availZones.length; i++) {
if (myZone != null && (availZones[i].equalsIgnoreCase(myZone.trim()) == preferSameZone)) {
return i;
}
}
logger.war... | java | private static int getZoneOffset(String myZone, boolean preferSameZone, String[] availZones) {
for (int i = 0; i < availZones.length; i++) {
if (myZone != null && (availZones[i].equalsIgnoreCase(myZone.trim()) == preferSameZone)) {
return i;
}
}
logger.war... | [
"private",
"static",
"int",
"getZoneOffset",
"(",
"String",
"myZone",
",",
"boolean",
"preferSameZone",
",",
"String",
"[",
"]",
"availZones",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"availZones",
".",
"length",
";",
"i",
"++",
")",
... | Gets the zone to pick up for this instance. | [
"Gets",
"the",
"zone",
"to",
"pick",
"up",
"for",
"this",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/endpoint/EndpointUtils.java#L373-L383 |
126,018 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/provider/DiscoveryJerseyProvider.java | DiscoveryJerseyProvider.isSupportedCharset | private static boolean isSupportedCharset(MediaType mediaType) {
Map<String, String> parameters = mediaType.getParameters();
if (parameters == null || parameters.isEmpty()) {
return true;
}
String charset = parameters.get("charset");
return charset == null
... | java | private static boolean isSupportedCharset(MediaType mediaType) {
Map<String, String> parameters = mediaType.getParameters();
if (parameters == null || parameters.isEmpty()) {
return true;
}
String charset = parameters.get("charset");
return charset == null
... | [
"private",
"static",
"boolean",
"isSupportedCharset",
"(",
"MediaType",
"mediaType",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"mediaType",
".",
"getParameters",
"(",
")",
";",
"if",
"(",
"parameters",
"==",
"null",
"||",
"parame... | As content is cached, we expect both ends use UTF-8 always. If no content charset encoding is explicitly
defined, UTF-8 is assumed as a default.
As legacy clients may use ISO 8859-1 we accept it as well, although result may be unspecified if
characters out of ASCII 0-127 range are used. | [
"As",
"content",
"is",
"cached",
"we",
"expect",
"both",
"ends",
"use",
"UTF",
"-",
"8",
"always",
".",
"If",
"no",
"content",
"charset",
"encoding",
"is",
"explicitly",
"defined",
"UTF",
"-",
"8",
"is",
"assumed",
"as",
"a",
"default",
".",
"As",
"leg... | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/provider/DiscoveryJerseyProvider.java#L154-L163 |
126,019 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.shutdown | @Override
public void shutdown() {
try {
DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(this));
} catch (Throwable t) {
logger.error("Cannot shutdown monitor registry", t);
}
try {
peerEurekaNodes.shutdown();
} ca... | java | @Override
public void shutdown() {
try {
DefaultMonitorRegistry.getInstance().unregister(Monitors.newObjectMonitor(this));
} catch (Throwable t) {
logger.error("Cannot shutdown monitor registry", t);
}
try {
peerEurekaNodes.shutdown();
} ca... | [
"@",
"Override",
"public",
"void",
"shutdown",
"(",
")",
"{",
"try",
"{",
"DefaultMonitorRegistry",
".",
"getInstance",
"(",
")",
".",
"unregister",
"(",
"Monitors",
".",
"newObjectMonitor",
"(",
"this",
")",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
... | Perform all cleanup and shutdown operations. | [
"Perform",
"all",
"cleanup",
"and",
"shutdown",
"operations",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L166-L181 |
126,020 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.syncUp | @Override
public int syncUp() {
// Copy entire entry from neighboring DS node
int count = 0;
for (int i = 0; ((i < serverConfig.getRegistrySyncRetries()) && (count == 0)); i++) {
if (i > 0) {
try {
Thread.sleep(serverConfig.getRegistrySyncRetr... | java | @Override
public int syncUp() {
// Copy entire entry from neighboring DS node
int count = 0;
for (int i = 0; ((i < serverConfig.getRegistrySyncRetries()) && (count == 0)); i++) {
if (i > 0) {
try {
Thread.sleep(serverConfig.getRegistrySyncRetr... | [
"@",
"Override",
"public",
"int",
"syncUp",
"(",
")",
"{",
"// Copy entire entry from neighboring DS node",
"int",
"count",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"(",
"(",
"i",
"<",
"serverConfig",
".",
"getRegistrySyncRetries",
"(",
")",
"... | Populates the registry information from a peer eureka node. This
operation fails over to other nodes until the list is exhausted if the
communication fails. | [
"Populates",
"the",
"registry",
"information",
"from",
"a",
"peer",
"eureka",
"node",
".",
"This",
"operation",
"fails",
"over",
"to",
"other",
"nodes",
"until",
"the",
"list",
"is",
"exhausted",
"if",
"the",
"communication",
"fails",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L205-L234 |
126,021 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.isBelowRenewThresold | @com.netflix.servo.annotations.Monitor(name = "isBelowRenewThreshold", description = "0 = false, 1 = true",
type = com.netflix.servo.annotations.DataSourceType.GAUGE)
@Override
public int isBelowRenewThresold() {
if ((getNumOfRenewsInLastMin() <= numberOfRenewsPerMinThreshold)
... | java | @com.netflix.servo.annotations.Monitor(name = "isBelowRenewThreshold", description = "0 = false, 1 = true",
type = com.netflix.servo.annotations.DataSourceType.GAUGE)
@Override
public int isBelowRenewThresold() {
if ((getNumOfRenewsInLastMin() <= numberOfRenewsPerMinThreshold)
... | [
"@",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"Monitor",
"(",
"name",
"=",
"\"isBelowRenewThreshold\"",
",",
"description",
"=",
"\"0 = false, 1 = true\"",
",",
"type",
"=",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"... | Checks if the number of renewals is lesser than threshold.
@return 0 if the renewals are greater than threshold, 1 otherwise. | [
"Checks",
"if",
"the",
"number",
"of",
"renewals",
"is",
"lesser",
"than",
"threshold",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L575-L586 |
126,022 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.isRegisterable | public boolean isRegisterable(InstanceInfo instanceInfo) {
DataCenterInfo datacenterInfo = instanceInfo.getDataCenterInfo();
String serverRegion = clientConfig.getRegion();
if (AmazonInfo.class.isInstance(datacenterInfo)) {
AmazonInfo info = AmazonInfo.class.cast(instanceInfo.getData... | java | public boolean isRegisterable(InstanceInfo instanceInfo) {
DataCenterInfo datacenterInfo = instanceInfo.getDataCenterInfo();
String serverRegion = clientConfig.getRegion();
if (AmazonInfo.class.isInstance(datacenterInfo)) {
AmazonInfo info = AmazonInfo.class.cast(instanceInfo.getData... | [
"public",
"boolean",
"isRegisterable",
"(",
"InstanceInfo",
"instanceInfo",
")",
"{",
"DataCenterInfo",
"datacenterInfo",
"=",
"instanceInfo",
".",
"getDataCenterInfo",
"(",
")",
";",
"String",
"serverRegion",
"=",
"clientConfig",
".",
"getRegion",
"(",
")",
";",
... | Checks if an instance is registerable in this region. Instances from other regions are rejected.
@param instanceInfo th instance info information of the instance
@return true, if it can be registered in this server, false otherwise. | [
"Checks",
"if",
"an",
"instance",
"is",
"registerable",
"in",
"this",
"region",
".",
"Instances",
"from",
"other",
"regions",
"are",
"rejected",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L594-L609 |
126,023 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.replicateToPeers | private void replicateToPeers(Action action, String appName, String id,
InstanceInfo info /* optional */,
InstanceStatus newStatus /* optional */, boolean isReplication) {
Stopwatch tracer = action.getTimer().start();
try {
... | java | private void replicateToPeers(Action action, String appName, String id,
InstanceInfo info /* optional */,
InstanceStatus newStatus /* optional */, boolean isReplication) {
Stopwatch tracer = action.getTimer().start();
try {
... | [
"private",
"void",
"replicateToPeers",
"(",
"Action",
"action",
",",
"String",
"appName",
",",
"String",
"id",
",",
"InstanceInfo",
"info",
"/* optional */",
",",
"InstanceStatus",
"newStatus",
"/* optional */",
",",
"boolean",
"isReplication",
")",
"{",
"Stopwatch"... | Replicates all eureka actions to peer eureka nodes except for replication
traffic to this node. | [
"Replicates",
"all",
"eureka",
"actions",
"to",
"peer",
"eureka",
"nodes",
"except",
"for",
"replication",
"traffic",
"to",
"this",
"node",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L616-L639 |
126,024 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.replicateInstanceActionsToPeers | private void replicateInstanceActionsToPeers(Action action, String appName,
String id, InstanceInfo info, InstanceStatus newStatus,
PeerEurekaNode node) {
try {
InstanceInfo infoFromRegistry = null;
... | java | private void replicateInstanceActionsToPeers(Action action, String appName,
String id, InstanceInfo info, InstanceStatus newStatus,
PeerEurekaNode node) {
try {
InstanceInfo infoFromRegistry = null;
... | [
"private",
"void",
"replicateInstanceActionsToPeers",
"(",
"Action",
"action",
",",
"String",
"appName",
",",
"String",
"id",
",",
"InstanceInfo",
"info",
",",
"InstanceStatus",
"newStatus",
",",
"PeerEurekaNode",
"node",
")",
"{",
"try",
"{",
"InstanceInfo",
"inf... | Replicates all instance changes to peer eureka nodes except for
replication traffic to this node. | [
"Replicates",
"all",
"instance",
"changes",
"to",
"peer",
"eureka",
"nodes",
"except",
"for",
"replication",
"traffic",
"to",
"this",
"node",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L646-L676 |
126,025 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java | PeerAwareInstanceRegistryImpl.replicateASGInfoToReplicaNodes | private void replicateASGInfoToReplicaNodes(final String asgName,
final ASGStatus newStatus, final PeerEurekaNode node) {
CurrentRequestVersion.set(Version.V2);
try {
node.statusUpdate(asgName, newStatus);
} catch (Throwable e) {
... | java | private void replicateASGInfoToReplicaNodes(final String asgName,
final ASGStatus newStatus, final PeerEurekaNode node) {
CurrentRequestVersion.set(Version.V2);
try {
node.statusUpdate(asgName, newStatus);
} catch (Throwable e) {
... | [
"private",
"void",
"replicateASGInfoToReplicaNodes",
"(",
"final",
"String",
"asgName",
",",
"final",
"ASGStatus",
"newStatus",
",",
"final",
"PeerEurekaNode",
"node",
")",
"{",
"CurrentRequestVersion",
".",
"set",
"(",
"Version",
".",
"V2",
")",
";",
"try",
"{"... | Replicates all ASG status changes to peer eureka nodes except for
replication traffic to this node. | [
"Replicates",
"all",
"ASG",
"status",
"changes",
"to",
"peer",
"eureka",
"nodes",
"except",
"for",
"replication",
"traffic",
"to",
"this",
"node",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/PeerAwareInstanceRegistryImpl.java#L682-L690 |
126,026 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.clearRegistry | @Override
public void clearRegistry() {
overriddenInstanceStatusMap.clear();
recentCanceledQueue.clear();
recentRegisteredQueue.clear();
recentlyChangedQueue.clear();
registry.clear();
} | java | @Override
public void clearRegistry() {
overriddenInstanceStatusMap.clear();
recentCanceledQueue.clear();
recentRegisteredQueue.clear();
recentlyChangedQueue.clear();
registry.clear();
} | [
"@",
"Override",
"public",
"void",
"clearRegistry",
"(",
")",
"{",
"overriddenInstanceStatusMap",
".",
"clear",
"(",
")",
";",
"recentCanceledQueue",
".",
"clear",
"(",
")",
";",
"recentRegisteredQueue",
".",
"clear",
"(",
")",
";",
"recentlyChangedQueue",
".",
... | Completely clear the registry. | [
"Completely",
"clear",
"the",
"registry",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L171-L178 |
126,027 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.cancel | @Override
public boolean cancel(String appName, String id, boolean isReplication) {
return internalCancel(appName, id, isReplication);
} | java | @Override
public boolean cancel(String appName, String id, boolean isReplication) {
return internalCancel(appName, id, isReplication);
} | [
"@",
"Override",
"public",
"boolean",
"cancel",
"(",
"String",
"appName",
",",
"String",
"id",
",",
"boolean",
"isReplication",
")",
"{",
"return",
"internalCancel",
"(",
"appName",
",",
"id",
",",
"isReplication",
")",
";",
"}"
] | Cancels the registration of an instance.
<p>
This is normally invoked by a client when it shuts down informing the
server to remove the instance from traffic.
</p>
@param appName the application name of the application.
@param id the unique identifier of the instance.
@param isReplication true if this is a replicatio... | [
"Cancels",
"the",
"registration",
"of",
"an",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L287-L290 |
126,028 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.renew | public boolean renew(String appName, String id, boolean isReplication) {
RENEW.increment(isReplication);
Map<String, Lease<InstanceInfo>> gMap = registry.get(appName);
Lease<InstanceInfo> leaseToRenew = null;
if (gMap != null) {
leaseToRenew = gMap.get(id);
}
... | java | public boolean renew(String appName, String id, boolean isReplication) {
RENEW.increment(isReplication);
Map<String, Lease<InstanceInfo>> gMap = registry.get(appName);
Lease<InstanceInfo> leaseToRenew = null;
if (gMap != null) {
leaseToRenew = gMap.get(id);
}
... | [
"public",
"boolean",
"renew",
"(",
"String",
"appName",
",",
"String",
"id",
",",
"boolean",
"isReplication",
")",
"{",
"RENEW",
".",
"increment",
"(",
"isReplication",
")",
";",
"Map",
"<",
"String",
",",
"Lease",
"<",
"InstanceInfo",
">",
">",
"gMap",
... | Marks the given instance of the given app name as renewed, and also marks whether it originated from
replication.
@see com.netflix.eureka.lease.LeaseManager#renew(java.lang.String, java.lang.String, boolean) | [
"Marks",
"the",
"given",
"instance",
"of",
"the",
"given",
"app",
"name",
"as",
"renewed",
"and",
"also",
"marks",
"whether",
"it",
"originated",
"from",
"replication",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L344-L381 |
126,029 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.storeOverriddenStatusIfRequired | @Override
public void storeOverriddenStatusIfRequired(String appName, String id, InstanceStatus overriddenStatus) {
InstanceStatus instanceStatus = overriddenInstanceStatusMap.get(id);
if ((instanceStatus == null) || (!overriddenStatus.equals(instanceStatus))) {
// We might not have the ... | java | @Override
public void storeOverriddenStatusIfRequired(String appName, String id, InstanceStatus overriddenStatus) {
InstanceStatus instanceStatus = overriddenInstanceStatusMap.get(id);
if ((instanceStatus == null) || (!overriddenStatus.equals(instanceStatus))) {
// We might not have the ... | [
"@",
"Override",
"public",
"void",
"storeOverriddenStatusIfRequired",
"(",
"String",
"appName",
",",
"String",
"id",
",",
"InstanceStatus",
"overriddenStatus",
")",
"{",
"InstanceStatus",
"instanceStatus",
"=",
"overriddenInstanceStatusMap",
".",
"get",
"(",
"id",
")"... | Stores overridden status if it is not already there. This happens during
a reconciliation process during renewal requests.
@param appName the application name of the instance.
@param id the unique identifier of the instance.
@param overriddenStatus overridden status if any. | [
"Stores",
"overridden",
"status",
"if",
"it",
"is",
"not",
"already",
"there",
".",
"This",
"happens",
"during",
"a",
"reconciliation",
"process",
"during",
"renewal",
"requests",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L424-L439 |
126,030 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.deleteStatusOverride | @Override
public boolean deleteStatusOverride(String appName, String id,
InstanceStatus newStatus,
String lastDirtyTimestamp,
boolean isReplication) {
try {
read.lock();
... | java | @Override
public boolean deleteStatusOverride(String appName, String id,
InstanceStatus newStatus,
String lastDirtyTimestamp,
boolean isReplication) {
try {
read.lock();
... | [
"@",
"Override",
"public",
"boolean",
"deleteStatusOverride",
"(",
"String",
"appName",
",",
"String",
"id",
",",
"InstanceStatus",
"newStatus",
",",
"String",
"lastDirtyTimestamp",
",",
"boolean",
"isReplication",
")",
"{",
"try",
"{",
"read",
".",
"lock",
"(",... | Removes status override for a give instance.
@param appName the application name of the instance.
@param id the unique identifier of the instance.
@param newStatus the new {@link InstanceStatus}.
@param lastDirtyTimestamp last timestamp when this instance information was updated.
@param isReplication true if this is a... | [
"Removes",
"status",
"override",
"for",
"a",
"give",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L519-L567 |
126,031 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.getApplication | @Override
public Application getApplication(String appName) {
boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion();
return this.getApplication(appName, !disableTransparentFallback);
} | java | @Override
public Application getApplication(String appName) {
boolean disableTransparentFallback = serverConfig.disableTransparentFallbackToOtherRegion();
return this.getApplication(appName, !disableTransparentFallback);
} | [
"@",
"Override",
"public",
"Application",
"getApplication",
"(",
"String",
"appName",
")",
"{",
"boolean",
"disableTransparentFallback",
"=",
"serverConfig",
".",
"disableTransparentFallbackToOtherRegion",
"(",
")",
";",
"return",
"this",
".",
"getApplication",
"(",
"... | Returns the given app that is in this instance only, falling back to other regions transparently only
if specified in this client configuration.
@param appName the application name of the application
@return the application
@see com.netflix.discovery.shared.LookupService#getApplication(java.lang.String) | [
"Returns",
"the",
"given",
"app",
"that",
"is",
"in",
"this",
"instance",
"only",
"falling",
"back",
"to",
"other",
"regions",
"transparently",
"only",
"if",
"specified",
"in",
"this",
"client",
"configuration",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L639-L643 |
126,032 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.getApplication | @Override
public Application getApplication(String appName, boolean includeRemoteRegion) {
Application app = null;
Map<String, Lease<InstanceInfo>> leaseMap = registry.get(appName);
if (leaseMap != null && leaseMap.size() > 0) {
for (Entry<String, Lease<InstanceInfo>> entry : l... | java | @Override
public Application getApplication(String appName, boolean includeRemoteRegion) {
Application app = null;
Map<String, Lease<InstanceInfo>> leaseMap = registry.get(appName);
if (leaseMap != null && leaseMap.size() > 0) {
for (Entry<String, Lease<InstanceInfo>> entry : l... | [
"@",
"Override",
"public",
"Application",
"getApplication",
"(",
"String",
"appName",
",",
"boolean",
"includeRemoteRegion",
")",
"{",
"Application",
"app",
"=",
"null",
";",
"Map",
"<",
"String",
",",
"Lease",
"<",
"InstanceInfo",
">",
">",
"leaseMap",
"=",
... | Get application information.
@param appName The name of the application
@param includeRemoteRegion true, if we need to include applications from remote regions
as indicated by the region {@link URL} by this property
{@link EurekaServerConfig#getRemoteRegionUrls()}, false otherwise
@return the application | [
"Get",
"application",
"information",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L654-L676 |
126,033 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.getNumOfRenewsInLastMin | @com.netflix.servo.annotations.Monitor(name = "numOfRenewsInLastMin",
description = "Number of total heartbeats received in the last minute", type = DataSourceType.GAUGE)
@Override
public long getNumOfRenewsInLastMin() {
return renewsLastMin.getCount();
} | java | @com.netflix.servo.annotations.Monitor(name = "numOfRenewsInLastMin",
description = "Number of total heartbeats received in the last minute", type = DataSourceType.GAUGE)
@Override
public long getNumOfRenewsInLastMin() {
return renewsLastMin.getCount();
} | [
"@",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"Monitor",
"(",
"name",
"=",
"\"numOfRenewsInLastMin\"",
",",
"description",
"=",
"\"Number of total heartbeats received in the last minute\"",
",",
"type",
"=",
"DataSourceType",
".",
"GAUGE",
")",
... | Servo route; do not call.
@return servo data | [
"Servo",
"route",
";",
"do",
"not",
"call",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L1132-L1137 |
126,034 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.getNumOfRenewsPerMinThreshold | @com.netflix.servo.annotations.Monitor(name = "numOfRenewsPerMinThreshold", type = DataSourceType.GAUGE)
@Override
public int getNumOfRenewsPerMinThreshold() {
return numberOfRenewsPerMinThreshold;
} | java | @com.netflix.servo.annotations.Monitor(name = "numOfRenewsPerMinThreshold", type = DataSourceType.GAUGE)
@Override
public int getNumOfRenewsPerMinThreshold() {
return numberOfRenewsPerMinThreshold;
} | [
"@",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"Monitor",
"(",
"name",
"=",
"\"numOfRenewsPerMinThreshold\"",
",",
"type",
"=",
"DataSourceType",
".",
"GAUGE",
")",
"@",
"Override",
"public",
"int",
"getNumOfRenewsPerMinThreshold",
"(",
")",
... | Gets the threshold for the renewals per minute.
@return the integer representing the threshold for the renewals per
minute. | [
"Gets",
"the",
"threshold",
"for",
"the",
"renewals",
"per",
"minute",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L1146-L1150 |
126,035 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.getLastNRegisteredInstances | @Override
public List<Pair<Long, String>> getLastNRegisteredInstances() {
List<Pair<Long, String>> list = new ArrayList<Pair<Long, String>>();
synchronized (recentRegisteredQueue) {
for (Pair<Long, String> aRecentRegisteredQueue : recentRegisteredQueue) {
list.add(aRecen... | java | @Override
public List<Pair<Long, String>> getLastNRegisteredInstances() {
List<Pair<Long, String>> list = new ArrayList<Pair<Long, String>>();
synchronized (recentRegisteredQueue) {
for (Pair<Long, String> aRecentRegisteredQueue : recentRegisteredQueue) {
list.add(aRecen... | [
"@",
"Override",
"public",
"List",
"<",
"Pair",
"<",
"Long",
",",
"String",
">",
">",
"getLastNRegisteredInstances",
"(",
")",
"{",
"List",
"<",
"Pair",
"<",
"Long",
",",
"String",
">",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"Pair",
"<",
"Long",
... | Get the N instances that are most recently registered.
@return | [
"Get",
"the",
"N",
"instances",
"that",
"are",
"most",
"recently",
"registered",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L1157-L1168 |
126,036 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java | AbstractInstanceRegistry.getLastNCanceledInstances | @Override
public List<Pair<Long, String>> getLastNCanceledInstances() {
List<Pair<Long, String>> list = new ArrayList<Pair<Long, String>>();
synchronized (recentCanceledQueue) {
for (Pair<Long, String> aRecentCanceledQueue : recentCanceledQueue) {
list.add(aRecentCanceled... | java | @Override
public List<Pair<Long, String>> getLastNCanceledInstances() {
List<Pair<Long, String>> list = new ArrayList<Pair<Long, String>>();
synchronized (recentCanceledQueue) {
for (Pair<Long, String> aRecentCanceledQueue : recentCanceledQueue) {
list.add(aRecentCanceled... | [
"@",
"Override",
"public",
"List",
"<",
"Pair",
"<",
"Long",
",",
"String",
">",
">",
"getLastNCanceledInstances",
"(",
")",
"{",
"List",
"<",
"Pair",
"<",
"Long",
",",
"String",
">",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"Pair",
"<",
"Long",
",... | Get the N instances that have most recently canceled.
@return | [
"Get",
"the",
"N",
"instances",
"that",
"have",
"most",
"recently",
"canceled",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/AbstractInstanceRegistry.java#L1175-L1185 |
126,037 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.handleEIPBinding | private void handleEIPBinding() throws InterruptedException {
int retries = serverConfig.getEIPBindRebindRetries();
// Bind to EIP if needed
for (int i = 0; i < retries; i++) {
try {
if (isEIPBound()) {
break;
} else {
... | java | private void handleEIPBinding() throws InterruptedException {
int retries = serverConfig.getEIPBindRebindRetries();
// Bind to EIP if needed
for (int i = 0; i < retries; i++) {
try {
if (isEIPBound()) {
break;
} else {
... | [
"private",
"void",
"handleEIPBinding",
"(",
")",
"throws",
"InterruptedException",
"{",
"int",
"retries",
"=",
"serverConfig",
".",
"getEIPBindRebindRetries",
"(",
")",
";",
"// Bind to EIP if needed",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"retries",
... | Handles EIP binding process in AWS Cloud.
@throws InterruptedException | [
"Handles",
"EIP",
"binding",
"process",
"in",
"AWS",
"Cloud",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L136-L153 |
126,038 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.isEIPBound | public boolean isEIPBound() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.availabilityZone);
String myPublicI... | java | public boolean isEIPBound() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.availabilityZone);
String myPublicI... | [
"public",
"boolean",
"isEIPBound",
"(",
")",
"{",
"InstanceInfo",
"myInfo",
"=",
"applicationInfoManager",
".",
"getInfo",
"(",
")",
";",
"String",
"myInstanceId",
"=",
"(",
"(",
"AmazonInfo",
")",
"myInfo",
".",
"getDataCenterInfo",
"(",
")",
")",
".",
"get... | Checks if an EIP is already bound to the instance.
@return true if an EIP is bound, false otherwise | [
"Checks",
"if",
"an",
"EIP",
"is",
"already",
"bound",
"to",
"the",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L159-L174 |
126,039 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.bindEIP | public void bindEIP() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.availabilityZone);
Collection<String> ca... | java | public void bindEIP() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(MetaDataKey.availabilityZone);
Collection<String> ca... | [
"public",
"void",
"bindEIP",
"(",
")",
"{",
"InstanceInfo",
"myInfo",
"=",
"applicationInfoManager",
".",
"getInfo",
"(",
")",
";",
"String",
"myInstanceId",
"=",
"(",
"(",
"AmazonInfo",
")",
"myInfo",
".",
"getDataCenterInfo",
"(",
")",
")",
".",
"get",
"... | Checks if an EIP is bound and optionally binds the EIP.
The list of EIPs are arranged with the EIPs allocated in the zone first
followed by other EIPs.
If an EIP is already bound to this instance this method simply returns. Otherwise, this method tries to find
an unused EIP based on information from AWS. If it cannot... | [
"Checks",
"if",
"an",
"EIP",
"is",
"bound",
"and",
"optionally",
"binds",
"the",
"EIP",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L193-L258 |
126,040 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.unbindEIP | public void unbindEIP() throws Exception {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myPublicIP = null;
if (myInfo != null
&& myInfo.getDataCenterInfo().getName() == Name.Amazon) {
myPublicIP = ((AmazonInfo) myInfo.getDataCenterInfo())
... | java | public void unbindEIP() throws Exception {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myPublicIP = null;
if (myInfo != null
&& myInfo.getDataCenterInfo().getName() == Name.Amazon) {
myPublicIP = ((AmazonInfo) myInfo.getDataCenterInfo())
... | [
"public",
"void",
"unbindEIP",
"(",
")",
"throws",
"Exception",
"{",
"InstanceInfo",
"myInfo",
"=",
"applicationInfoManager",
".",
"getInfo",
"(",
")",
";",
"String",
"myPublicIP",
"=",
"null",
";",
"if",
"(",
"myInfo",
"!=",
"null",
"&&",
"myInfo",
".",
"... | Unbind the EIP that this instance is associated with. | [
"Unbind",
"the",
"EIP",
"that",
"this",
"instance",
"is",
"associated",
"with",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L263-L298 |
126,041 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.getCandidateEIPs | public Collection<String> getCandidateEIPs(String myInstanceId, String myZone) {
if (myZone == null) {
myZone = "us-east-1d";
}
Collection<String> eipCandidates = clientConfig.shouldUseDnsForFetchingServiceUrls()
? getEIPsForZoneFromDNS(myZone)
... | java | public Collection<String> getCandidateEIPs(String myInstanceId, String myZone) {
if (myZone == null) {
myZone = "us-east-1d";
}
Collection<String> eipCandidates = clientConfig.shouldUseDnsForFetchingServiceUrls()
? getEIPsForZoneFromDNS(myZone)
... | [
"public",
"Collection",
"<",
"String",
">",
"getCandidateEIPs",
"(",
"String",
"myInstanceId",
",",
"String",
"myZone",
")",
"{",
"if",
"(",
"myZone",
"==",
"null",
")",
"{",
"myZone",
"=",
"\"us-east-1d\"",
";",
"}",
"Collection",
"<",
"String",
">",
"eip... | Get the list of EIPs in the order of preference depending on instance zone.
@param myInstanceId
the instance id for this instance
@param myZone
the zone where this instance is in
@return Collection containing the list of available EIPs | [
"Get",
"the",
"list",
"of",
"EIPs",
"in",
"the",
"order",
"of",
"preference",
"depending",
"on",
"instance",
"zone",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L309-L324 |
126,042 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.getEIPsForZoneFromConfig | private Collection<String> getEIPsForZoneFromConfig(String myZone) {
List<String> ec2Urls = clientConfig.getEurekaServerServiceUrls(myZone);
return getEIPsFromServiceUrls(ec2Urls);
} | java | private Collection<String> getEIPsForZoneFromConfig(String myZone) {
List<String> ec2Urls = clientConfig.getEurekaServerServiceUrls(myZone);
return getEIPsFromServiceUrls(ec2Urls);
} | [
"private",
"Collection",
"<",
"String",
">",
"getEIPsForZoneFromConfig",
"(",
"String",
"myZone",
")",
"{",
"List",
"<",
"String",
">",
"ec2Urls",
"=",
"clientConfig",
".",
"getEurekaServerServiceUrls",
"(",
"myZone",
")",
";",
"return",
"getEIPsFromServiceUrls",
... | Get the list of EIPs from the configuration.
@param myZone
- the zone in which the instance resides.
@return collection of EIPs to choose from for binding. | [
"Get",
"the",
"list",
"of",
"EIPs",
"from",
"the",
"configuration",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L333-L336 |
126,043 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.getEIPsFromServiceUrls | private Collection<String> getEIPsFromServiceUrls(List<String> ec2Urls) {
List<String> returnedUrls = new ArrayList<String>();
String region = clientConfig.getRegion();
String regionPhrase = "";
if (!US_EAST_1.equals(region)) {
regionPhrase = "." + region;
}
f... | java | private Collection<String> getEIPsFromServiceUrls(List<String> ec2Urls) {
List<String> returnedUrls = new ArrayList<String>();
String region = clientConfig.getRegion();
String regionPhrase = "";
if (!US_EAST_1.equals(region)) {
regionPhrase = "." + region;
}
f... | [
"private",
"Collection",
"<",
"String",
">",
"getEIPsFromServiceUrls",
"(",
"List",
"<",
"String",
">",
"ec2Urls",
")",
"{",
"List",
"<",
"String",
">",
"returnedUrls",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
")",
";",
"String",
"region",
"=",
... | Get the list of EIPs from the ec2 urls.
@param ec2Urls
the ec2urls for which the EIP needs to be obtained.
@return collection of EIPs. | [
"Get",
"the",
"list",
"of",
"EIPs",
"from",
"the",
"ec2",
"urls",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L345-L369 |
126,044 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.getEIPsForZoneFromDNS | private Collection<String> getEIPsForZoneFromDNS(String myZone) {
List<String> ec2Urls = EndpointUtils.getServiceUrlsFromDNS(
clientConfig,
myZone,
true,
new EndpointUtils.InstanceInfoBasedUrlRandomizer(applicationInfoManager.getInfo())
);
... | java | private Collection<String> getEIPsForZoneFromDNS(String myZone) {
List<String> ec2Urls = EndpointUtils.getServiceUrlsFromDNS(
clientConfig,
myZone,
true,
new EndpointUtils.InstanceInfoBasedUrlRandomizer(applicationInfoManager.getInfo())
);
... | [
"private",
"Collection",
"<",
"String",
">",
"getEIPsForZoneFromDNS",
"(",
"String",
"myZone",
")",
"{",
"List",
"<",
"String",
">",
"ec2Urls",
"=",
"EndpointUtils",
".",
"getServiceUrlsFromDNS",
"(",
"clientConfig",
",",
"myZone",
",",
"true",
",",
"new",
"En... | Get the list of EIPS from the DNS.
<p>
This mechanism looks for the EIP pool in the zone the instance is in by
looking up the DNS name <code>{zone}.{region}.{domainName}</code>. The
zone is fetched from the {@link InstanceInfo} object;the region is picked
up from the specified configuration
{@link com.netflix.discover... | [
"Get",
"the",
"list",
"of",
"EIPS",
"from",
"the",
"DNS",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L390-L398 |
126,045 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java | EIPManager.getEC2Service | private AmazonEC2 getEC2Service() {
String aWSAccessId = serverConfig.getAWSAccessId();
String aWSSecretKey = serverConfig.getAWSSecretKey();
AmazonEC2 ec2Service;
if (null != aWSAccessId && !"".equals(aWSAccessId)
&& null != aWSSecretKey && !"".equals(aWSSecretKey)) {
... | java | private AmazonEC2 getEC2Service() {
String aWSAccessId = serverConfig.getAWSAccessId();
String aWSSecretKey = serverConfig.getAWSSecretKey();
AmazonEC2 ec2Service;
if (null != aWSAccessId && !"".equals(aWSAccessId)
&& null != aWSSecretKey && !"".equals(aWSSecretKey)) {
... | [
"private",
"AmazonEC2",
"getEC2Service",
"(",
")",
"{",
"String",
"aWSAccessId",
"=",
"serverConfig",
".",
"getAWSAccessId",
"(",
")",
";",
"String",
"aWSSecretKey",
"=",
"serverConfig",
".",
"getAWSSecretKey",
"(",
")",
";",
"AmazonEC2",
"ec2Service",
";",
"if"... | Gets the EC2 service object to call AWS APIs.
@return the EC2 service object to call AWS APIs. | [
"Gets",
"the",
"EC2",
"service",
"object",
"to",
"call",
"AWS",
"APIs",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/EIPManager.java#L405-L421 |
126,046 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/Application.java | Application.addInstance | public void addInstance(InstanceInfo i) {
instancesMap.put(i.getId(), i);
synchronized (instances) {
instances.remove(i);
instances.add(i);
isDirty = true;
}
} | java | public void addInstance(InstanceInfo i) {
instancesMap.put(i.getId(), i);
synchronized (instances) {
instances.remove(i);
instances.add(i);
isDirty = true;
}
} | [
"public",
"void",
"addInstance",
"(",
"InstanceInfo",
"i",
")",
"{",
"instancesMap",
".",
"put",
"(",
"i",
".",
"getId",
"(",
")",
",",
"i",
")",
";",
"synchronized",
"(",
"instances",
")",
"{",
"instances",
".",
"remove",
"(",
"i",
")",
";",
"instan... | Add the given instance info the list.
@param i
the instance info object to be added. | [
"Add",
"the",
"given",
"instance",
"info",
"the",
"list",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/Application.java#L106-L113 |
126,047 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/transport/EurekaHttpClients.java | EurekaHttpClients.failFastOnInitCheck | private static void failFastOnInitCheck(EurekaClientConfig clientConfig, String msg) {
if ("true".equals(clientConfig.getExperimental("clientTransportFailFastOnInit"))) {
throw new RuntimeException(msg);
}
} | java | private static void failFastOnInitCheck(EurekaClientConfig clientConfig, String msg) {
if ("true".equals(clientConfig.getExperimental("clientTransportFailFastOnInit"))) {
throw new RuntimeException(msg);
}
} | [
"private",
"static",
"void",
"failFastOnInitCheck",
"(",
"EurekaClientConfig",
"clientConfig",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"\"true\"",
".",
"equals",
"(",
"clientConfig",
".",
"getExperimental",
"(",
"\"clientTransportFailFastOnInit\"",
")",
")",
")",... | potential future feature, guarding with experimental flag for now | [
"potential",
"future",
"feature",
"guarding",
"with",
"experimental",
"flag",
"for",
"now"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/transport/EurekaHttpClients.java#L322-L326 |
126,048 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/EurekaBootStrap.java | EurekaBootStrap.contextInitialized | @Override
public void contextInitialized(ServletContextEvent event) {
try {
initEurekaEnvironment();
initEurekaServerContext();
ServletContext sc = event.getServletContext();
sc.setAttribute(EurekaServerContext.class.getName(), serverContext);
} catch... | java | @Override
public void contextInitialized(ServletContextEvent event) {
try {
initEurekaEnvironment();
initEurekaServerContext();
ServletContext sc = event.getServletContext();
sc.setAttribute(EurekaServerContext.class.getName(), serverContext);
} catch... | [
"@",
"Override",
"public",
"void",
"contextInitialized",
"(",
"ServletContextEvent",
"event",
")",
"{",
"try",
"{",
"initEurekaEnvironment",
"(",
")",
";",
"initEurekaServerContext",
"(",
")",
";",
"ServletContext",
"sc",
"=",
"event",
".",
"getServletContext",
"(... | Initializes Eureka, including syncing up with other Eureka peers and publishing the registry.
@see
javax.servlet.ServletContextListener#contextInitialized(javax.servlet.ServletContextEvent) | [
"Initializes",
"Eureka",
"including",
"syncing",
"up",
"with",
"other",
"Eureka",
"peers",
"and",
"publishing",
"the",
"registry",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/EurekaBootStrap.java#L110-L122 |
126,049 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/EurekaBootStrap.java | EurekaBootStrap.initEurekaServerContext | protected void initEurekaServerContext() throws Exception {
EurekaServerConfig eurekaServerConfig = new DefaultEurekaServerConfig();
// For backward compatibility
JsonXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(), XStream.PRIORITY_VERY_HIGH);
XmlXStream.getI... | java | protected void initEurekaServerContext() throws Exception {
EurekaServerConfig eurekaServerConfig = new DefaultEurekaServerConfig();
// For backward compatibility
JsonXStream.getInstance().registerConverter(new V1AwareInstanceInfoConverter(), XStream.PRIORITY_VERY_HIGH);
XmlXStream.getI... | [
"protected",
"void",
"initEurekaServerContext",
"(",
")",
"throws",
"Exception",
"{",
"EurekaServerConfig",
"eurekaServerConfig",
"=",
"new",
"DefaultEurekaServerConfig",
"(",
")",
";",
"// For backward compatibility",
"JsonXStream",
".",
"getInstance",
"(",
")",
".",
"... | init hook for server context. Override for custom logic. | [
"init",
"hook",
"for",
"server",
"context",
".",
"Override",
"for",
"custom",
"logic",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/EurekaBootStrap.java#L147-L220 |
126,050 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/EurekaBootStrap.java | EurekaBootStrap.contextDestroyed | @Override
public void contextDestroyed(ServletContextEvent event) {
try {
logger.info("{} Shutting down Eureka Server..", new Date());
ServletContext sc = event.getServletContext();
sc.removeAttribute(EurekaServerContext.class.getName());
destroyEurekaServerC... | java | @Override
public void contextDestroyed(ServletContextEvent event) {
try {
logger.info("{} Shutting down Eureka Server..", new Date());
ServletContext sc = event.getServletContext();
sc.removeAttribute(EurekaServerContext.class.getName());
destroyEurekaServerC... | [
"@",
"Override",
"public",
"void",
"contextDestroyed",
"(",
"ServletContextEvent",
"event",
")",
"{",
"try",
"{",
"logger",
".",
"info",
"(",
"\"{} Shutting down Eureka Server..\"",
",",
"new",
"Date",
"(",
")",
")",
";",
"ServletContext",
"sc",
"=",
"event",
... | Handles Eureka cleanup, including shutting down all monitors and yielding all EIPs.
@see javax.servlet.ServletContextListener#contextDestroyed(javax.servlet.ServletContextEvent) | [
"Handles",
"Eureka",
"cleanup",
"including",
"shutting",
"down",
"all",
"monitors",
"and",
"yielding",
"all",
"EIPs",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/EurekaBootStrap.java#L239-L253 |
126,051 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java | PeerEurekaNodes.resolvePeerUrls | protected List<String> resolvePeerUrls() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String zone = InstanceInfo.getZone(clientConfig.getAvailabilityZones(clientConfig.getRegion()), myInfo);
List<String> replicaUrls = EndpointUtils
.getDiscoveryServiceUrls(clientConf... | java | protected List<String> resolvePeerUrls() {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String zone = InstanceInfo.getZone(clientConfig.getAvailabilityZones(clientConfig.getRegion()), myInfo);
List<String> replicaUrls = EndpointUtils
.getDiscoveryServiceUrls(clientConf... | [
"protected",
"List",
"<",
"String",
">",
"resolvePeerUrls",
"(",
")",
"{",
"InstanceInfo",
"myInfo",
"=",
"applicationInfoManager",
".",
"getInfo",
"(",
")",
";",
"String",
"zone",
"=",
"InstanceInfo",
".",
"getZone",
"(",
"clientConfig",
".",
"getAvailabilityZo... | Resolve peer URLs.
@return peer URLs with node's own URL filtered out | [
"Resolve",
"peer",
"URLs",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java#L131-L146 |
126,052 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java | PeerEurekaNodes.isThisMyUrl | public boolean isThisMyUrl(String url) {
final String myUrlConfigured = serverConfig.getMyUrl();
if (myUrlConfigured != null) {
return myUrlConfigured.equals(url);
}
return isInstanceURL(url, applicationInfoManager.getInfo());
} | java | public boolean isThisMyUrl(String url) {
final String myUrlConfigured = serverConfig.getMyUrl();
if (myUrlConfigured != null) {
return myUrlConfigured.equals(url);
}
return isInstanceURL(url, applicationInfoManager.getInfo());
} | [
"public",
"boolean",
"isThisMyUrl",
"(",
"String",
"url",
")",
"{",
"final",
"String",
"myUrlConfigured",
"=",
"serverConfig",
".",
"getMyUrl",
"(",
")",
";",
"if",
"(",
"myUrlConfigured",
"!=",
"null",
")",
"{",
"return",
"myUrlConfigured",
".",
"equals",
"... | Checks if the given service url contains the current host which is trying
to replicate. Only after the EIP binding is done the host has a chance to
identify itself in the list of replica nodes and needs to take itself out
of replication traffic.
@param url the service url of the replica node that the check is made.
@r... | [
"Checks",
"if",
"the",
"given",
"service",
"url",
"contains",
"the",
"current",
"host",
"which",
"is",
"trying",
"to",
"replicate",
".",
"Only",
"after",
"the",
"EIP",
"binding",
"is",
"done",
"the",
"host",
"has",
"a",
"chance",
"to",
"identify",
"itself"... | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java#L235-L241 |
126,053 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java | PeerEurekaNodes.isInstanceURL | public boolean isInstanceURL(String url, InstanceInfo instance) {
String hostName = hostFromUrl(url);
String myInfoComparator = instance.getHostName();
if (clientConfig.getTransportConfig().applicationsResolverUseIp()) {
myInfoComparator = instance.getIPAddr();
}
retu... | java | public boolean isInstanceURL(String url, InstanceInfo instance) {
String hostName = hostFromUrl(url);
String myInfoComparator = instance.getHostName();
if (clientConfig.getTransportConfig().applicationsResolverUseIp()) {
myInfoComparator = instance.getIPAddr();
}
retu... | [
"public",
"boolean",
"isInstanceURL",
"(",
"String",
"url",
",",
"InstanceInfo",
"instance",
")",
"{",
"String",
"hostName",
"=",
"hostFromUrl",
"(",
"url",
")",
";",
"String",
"myInfoComparator",
"=",
"instance",
".",
"getHostName",
"(",
")",
";",
"if",
"("... | Checks if the given service url matches the supplied instance
@param url the service url of the replica node that the check is made.
@param instance the instance to check the service url against
@return true, if the url represents the supplied instance, false otherwise. | [
"Checks",
"if",
"the",
"given",
"service",
"url",
"matches",
"the",
"supplied",
"instance"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNodes.java#L250-L257 |
126,054 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/StringUtil.java | StringUtil.join | public static String join(String... values) {
if (values == null || values.length == 0) {
return null;
}
StringBuilder sb = new StringBuilder();
for (String value : values) {
sb.append(',').append(value);
}
return sb.substring(1);
} | java | public static String join(String... values) {
if (values == null || values.length == 0) {
return null;
}
StringBuilder sb = new StringBuilder();
for (String value : values) {
sb.append(',').append(value);
}
return sb.substring(1);
} | [
"public",
"static",
"String",
"join",
"(",
"String",
"...",
"values",
")",
"{",
"if",
"(",
"values",
"==",
"null",
"||",
"values",
".",
"length",
"==",
"0",
")",
"{",
"return",
"null",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
... | Join all values separating them with a comma. | [
"Join",
"all",
"values",
"separating",
"them",
"with",
"a",
"comma",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/StringUtil.java#L27-L36 |
126,055 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/endpoint/DnsResolver.java | DnsResolver.resolve | public static String resolve(String originalHost) {
String currentHost = originalHost;
if (isLocalOrIp(currentHost)) {
return originalHost;
}
try {
String targetHost = null;
do {
Attributes attrs = getDirContext().getAttributes(currentH... | java | public static String resolve(String originalHost) {
String currentHost = originalHost;
if (isLocalOrIp(currentHost)) {
return originalHost;
}
try {
String targetHost = null;
do {
Attributes attrs = getDirContext().getAttributes(currentH... | [
"public",
"static",
"String",
"resolve",
"(",
"String",
"originalHost",
")",
"{",
"String",
"currentHost",
"=",
"originalHost",
";",
"if",
"(",
"isLocalOrIp",
"(",
"currentHost",
")",
")",
"{",
"return",
"originalHost",
";",
"}",
"try",
"{",
"String",
"targe... | Resolve host name to the bottom A-Record or the latest available CNAME
@return resolved host name | [
"Resolve",
"host",
"name",
"to",
"the",
"bottom",
"A",
"-",
"Record",
"or",
"the",
"latest",
"available",
"CNAME"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/endpoint/DnsResolver.java#L59-L85 |
126,056 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/endpoint/DnsResolver.java | DnsResolver.resolveARecord | @Nullable
public static List<String> resolveARecord(String rootDomainName) {
if (isLocalOrIp(rootDomainName)) {
return null;
}
try {
Attributes attrs = getDirContext().getAttributes(rootDomainName, new String[]{A_RECORD_TYPE, CNAME_RECORD_TYPE});
Attribute... | java | @Nullable
public static List<String> resolveARecord(String rootDomainName) {
if (isLocalOrIp(rootDomainName)) {
return null;
}
try {
Attributes attrs = getDirContext().getAttributes(rootDomainName, new String[]{A_RECORD_TYPE, CNAME_RECORD_TYPE});
Attribute... | [
"@",
"Nullable",
"public",
"static",
"List",
"<",
"String",
">",
"resolveARecord",
"(",
"String",
"rootDomainName",
")",
"{",
"if",
"(",
"isLocalOrIp",
"(",
"rootDomainName",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"Attributes",
"attrs",
"="... | Look into A-record at a specific DNS address.
@return resolved IP addresses or null if no A-record was present | [
"Look",
"into",
"A",
"-",
"record",
"at",
"a",
"specific",
"DNS",
"address",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/endpoint/DnsResolver.java#L92-L114 |
126,057 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/ASGResource.java | ASGResource.statusUpdate | @PUT
@Path("{asgName}/status")
public Response statusUpdate(@PathParam("asgName") String asgName,
@QueryParam("value") String newStatus,
@HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) {
if (awsAsgUtil == null) {
... | java | @PUT
@Path("{asgName}/status")
public Response statusUpdate(@PathParam("asgName") String asgName,
@QueryParam("value") String newStatus,
@HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) {
if (awsAsgUtil == null) {
... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"{asgName}/status\"",
")",
"public",
"Response",
"statusUpdate",
"(",
"@",
"PathParam",
"(",
"\"asgName\"",
")",
"String",
"asgName",
",",
"@",
"QueryParam",
"(",
"\"value\"",
")",
"String",
"newStatus",
",",
"@",
"HeaderParam",... | Changes the status information of the ASG.
@param asgName the name of the ASG for which the status needs to be changed.
@param newStatus the new status {@link ASGStatus} of the ASG.
@param isReplication a header parameter containing information whether this is replicated from other nodes.
@return response which indic... | [
"Changes",
"the",
"status",
"information",
"of",
"the",
"ASG",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/ASGResource.java#L103-L124 |
126,058 | Netflix/eureka | eureka-client-archaius2/src/main/java/com/netflix/appinfo/providers/CompositeInstanceConfigFactory.java | CompositeInstanceConfigFactory.autoDetectEc2 | private boolean autoDetectEc2(AmazonInfoConfig amazonInfoConfig) {
try {
URL url = AmazonInfo.MetaDataKey.instanceId.getURL(null, null);
String id = AmazonInfoUtils.readEc2MetadataUrl(
AmazonInfo.MetaDataKey.instanceId,
url,
ama... | java | private boolean autoDetectEc2(AmazonInfoConfig amazonInfoConfig) {
try {
URL url = AmazonInfo.MetaDataKey.instanceId.getURL(null, null);
String id = AmazonInfoUtils.readEc2MetadataUrl(
AmazonInfo.MetaDataKey.instanceId,
url,
ama... | [
"private",
"boolean",
"autoDetectEc2",
"(",
"AmazonInfoConfig",
"amazonInfoConfig",
")",
"{",
"try",
"{",
"URL",
"url",
"=",
"AmazonInfo",
".",
"MetaDataKey",
".",
"instanceId",
".",
"getURL",
"(",
"null",
",",
"null",
")",
";",
"String",
"id",
"=",
"AmazonI... | best effort try to determine if we are in ec2 by trying to read the instanceId from metadata url | [
"best",
"effort",
"try",
"to",
"determine",
"if",
"we",
"are",
"in",
"ec2",
"by",
"trying",
"to",
"read",
"the",
"instanceId",
"from",
"metadata",
"url"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client-archaius2/src/main/java/com/netflix/appinfo/providers/CompositeInstanceConfigFactory.java#L100-L123 |
126,059 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/PeerReplicationResource.java | PeerReplicationResource.batchReplication | @Path("batch")
@POST
public Response batchReplication(ReplicationList replicationList) {
try {
ReplicationListResponse batchResponse = new ReplicationListResponse();
for (ReplicationInstance instanceInfo : replicationList.getReplicationList()) {
try {
... | java | @Path("batch")
@POST
public Response batchReplication(ReplicationList replicationList) {
try {
ReplicationListResponse batchResponse = new ReplicationListResponse();
for (ReplicationInstance instanceInfo : replicationList.getReplicationList()) {
try {
... | [
"@",
"Path",
"(",
"\"batch\"",
")",
"@",
"POST",
"public",
"Response",
"batchReplication",
"(",
"ReplicationList",
"replicationList",
")",
"{",
"try",
"{",
"ReplicationListResponse",
"batchResponse",
"=",
"new",
"ReplicationListResponse",
"(",
")",
";",
"for",
"("... | Process batched replication events from peer eureka nodes.
<p>
The batched events are delegated to underlying resources to generate a
{@link ReplicationListResponse} containing the individual responses to the batched events
</p>
@param replicationList
The List of replication events from peer eureka nodes
@return A ba... | [
"Process",
"batched",
"replication",
"events",
"from",
"peer",
"eureka",
"nodes",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/PeerReplicationResource.java#L78-L97 |
126,060 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/resolver/ResolverUtils.java | ResolverUtils.randomize | public static <T extends EurekaEndpoint> List<T> randomize(List<T> list) {
List<T> randomList = new ArrayList<>(list);
if (randomList.size() < 2) {
return randomList;
}
Random random = new Random(LOCAL_IPV4_ADDRESS.hashCode());
int last = randomList.size() - 1;
... | java | public static <T extends EurekaEndpoint> List<T> randomize(List<T> list) {
List<T> randomList = new ArrayList<>(list);
if (randomList.size() < 2) {
return randomList;
}
Random random = new Random(LOCAL_IPV4_ADDRESS.hashCode());
int last = randomList.size() - 1;
... | [
"public",
"static",
"<",
"T",
"extends",
"EurekaEndpoint",
">",
"List",
"<",
"T",
">",
"randomize",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"List",
"<",
"T",
">",
"randomList",
"=",
"new",
"ArrayList",
"<>",
"(",
"list",
")",
";",
"if",
"(",
... | Randomize server list using local IPv4 address hash as a seed.
@return a copy of the original list with elements in the random order | [
"Randomize",
"server",
"list",
"using",
"local",
"IPv4",
"address",
"hash",
"as",
"a",
"seed",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/resolver/ResolverUtils.java#L88-L102 |
126,061 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.init | public static ObjectReader init(ObjectReader reader) {
return reader.withAttribute(ATTR_STRING_CACHE, new DeserializerStringCache(
new HashMap<CharBuffer, String>(2048), new LinkedHashMap<CharBuffer, String>(4096, 0.75f, true) {
@Override
protected boolean... | java | public static ObjectReader init(ObjectReader reader) {
return reader.withAttribute(ATTR_STRING_CACHE, new DeserializerStringCache(
new HashMap<CharBuffer, String>(2048), new LinkedHashMap<CharBuffer, String>(4096, 0.75f, true) {
@Override
protected boolean... | [
"public",
"static",
"ObjectReader",
"init",
"(",
"ObjectReader",
"reader",
")",
"{",
"return",
"reader",
".",
"withAttribute",
"(",
"ATTR_STRING_CACHE",
",",
"new",
"DeserializerStringCache",
"(",
"new",
"HashMap",
"<",
"CharBuffer",
",",
"String",
">",
"(",
"20... | adds a new DeserializerStringCache to the passed-in ObjectReader
@param reader
@return a wrapped ObjectReader with the string cache attribute | [
"adds",
"a",
"new",
"DeserializerStringCache",
"to",
"the",
"passed",
"-",
"in",
"ObjectReader"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L54-L63 |
126,062 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.init | public static ObjectReader init(ObjectReader reader, DeserializationContext context) {
return withCache(context, cache -> {
if (cache == null)
throw new IllegalStateException();
return reader.withAttribute(ATTR_STRING_CACHE, cache);
});
} | java | public static ObjectReader init(ObjectReader reader, DeserializationContext context) {
return withCache(context, cache -> {
if (cache == null)
throw new IllegalStateException();
return reader.withAttribute(ATTR_STRING_CACHE, cache);
});
} | [
"public",
"static",
"ObjectReader",
"init",
"(",
"ObjectReader",
"reader",
",",
"DeserializationContext",
"context",
")",
"{",
"return",
"withCache",
"(",
"context",
",",
"cache",
"->",
"{",
"if",
"(",
"cache",
"==",
"null",
")",
"throw",
"new",
"IllegalStateE... | adds an existing DeserializerStringCache from the DeserializationContext
to an ObjectReader
@param reader
a new ObjectReader
@param context
an existing DeserializationContext containing a
DeserializerStringCache
@return a wrapped ObjectReader with the string cache attribute | [
"adds",
"an",
"existing",
"DeserializerStringCache",
"from",
"the",
"DeserializationContext",
"to",
"an",
"ObjectReader"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L76-L82 |
126,063 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.from | public static DeserializerStringCache from(DeserializationContext context) {
return withCache(context, cache -> {
if (cache == null) {
cache = new DeserializerStringCache(new HashMap<CharBuffer, String>(),
new HashMap<CharBuffer, String>());
}
... | java | public static DeserializerStringCache from(DeserializationContext context) {
return withCache(context, cache -> {
if (cache == null) {
cache = new DeserializerStringCache(new HashMap<CharBuffer, String>(),
new HashMap<CharBuffer, String>());
}
... | [
"public",
"static",
"DeserializerStringCache",
"from",
"(",
"DeserializationContext",
"context",
")",
"{",
"return",
"withCache",
"(",
"context",
",",
"cache",
"->",
"{",
"if",
"(",
"cache",
"==",
"null",
")",
"{",
"cache",
"=",
"new",
"DeserializerStringCache",... | extracts a DeserializerStringCache from the DeserializationContext
@param context
an existing DeserializationContext containing a
DeserializerStringCache
@return a wrapped ObjectReader with the string cache attribute | [
"extracts",
"a",
"DeserializerStringCache",
"from",
"the",
"DeserializationContext"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L92-L100 |
126,064 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.clear | public static void clear(ObjectReader reader, final CacheScope scope) {
withCache(reader, cache -> {
if (scope == CacheScope.GLOBAL_SCOPE) {
if (debugLogEnabled)
logger.debug("clearing global-level cache with size {}", cache.globalCache.size());
ca... | java | public static void clear(ObjectReader reader, final CacheScope scope) {
withCache(reader, cache -> {
if (scope == CacheScope.GLOBAL_SCOPE) {
if (debugLogEnabled)
logger.debug("clearing global-level cache with size {}", cache.globalCache.size());
ca... | [
"public",
"static",
"void",
"clear",
"(",
"ObjectReader",
"reader",
",",
"final",
"CacheScope",
"scope",
")",
"{",
"withCache",
"(",
"reader",
",",
"cache",
"->",
"{",
"if",
"(",
"scope",
"==",
"CacheScope",
".",
"GLOBAL_SCOPE",
")",
"{",
"if",
"(",
"deb... | clears cache entries in the given scope from the specified ObjectReader.
Always clears app-scoped entries.
@param reader
@param scope | [
"clears",
"cache",
"entries",
"in",
"the",
"given",
"scope",
"from",
"the",
"specified",
"ObjectReader",
".",
"Always",
"clears",
"app",
"-",
"scoped",
"entries",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L118-L130 |
126,065 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.clear | public static void clear(DeserializationContext context, CacheScope scope) {
withCache(context, cache -> {
if (scope == CacheScope.GLOBAL_SCOPE) {
if (debugLogEnabled)
logger.debug("clearing global-level serialization cache with size {}", cache.globalCache.size())... | java | public static void clear(DeserializationContext context, CacheScope scope) {
withCache(context, cache -> {
if (scope == CacheScope.GLOBAL_SCOPE) {
if (debugLogEnabled)
logger.debug("clearing global-level serialization cache with size {}", cache.globalCache.size())... | [
"public",
"static",
"void",
"clear",
"(",
"DeserializationContext",
"context",
",",
"CacheScope",
"scope",
")",
"{",
"withCache",
"(",
"context",
",",
"cache",
"->",
"{",
"if",
"(",
"scope",
"==",
"CacheScope",
".",
"GLOBAL_SCOPE",
")",
"{",
"if",
"(",
"de... | clears cache entries in the given scope from the specified
DeserializationContext. Always clears app-scoped entries.
@param context
@param scope | [
"clears",
"cache",
"entries",
"in",
"the",
"given",
"scope",
"from",
"the",
"specified",
"DeserializationContext",
".",
"Always",
"clears",
"app",
"-",
"scoped",
"entries",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L148-L160 |
126,066 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(final JsonParser jp) throws IOException {
return apply(jp, CacheScope.APPLICATION_SCOPE, null);
} | java | public String apply(final JsonParser jp) throws IOException {
return apply(jp, CacheScope.APPLICATION_SCOPE, null);
} | [
"public",
"String",
"apply",
"(",
"final",
"JsonParser",
"jp",
")",
"throws",
"IOException",
"{",
"return",
"apply",
"(",
"jp",
",",
"CacheScope",
".",
"APPLICATION_SCOPE",
",",
"null",
")",
";",
"}"
] | returns a String read from the JsonParser argument's current position.
The returned value may be interned at the app scope to reduce heap
consumption
@param jp
@return a possibly interned String
@throws IOException | [
"returns",
"a",
"String",
"read",
"from",
"the",
"JsonParser",
"argument",
"s",
"current",
"position",
".",
"The",
"returned",
"value",
"may",
"be",
"interned",
"at",
"the",
"app",
"scope",
"to",
"reduce",
"heap",
"consumption"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L191-L193 |
126,067 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(final JsonParser jp, CacheScope cacheScope, Supplier<String> source) throws IOException {
return apply(CharBuffer.wrap(jp, source), cacheScope);
} | java | public String apply(final JsonParser jp, CacheScope cacheScope, Supplier<String> source) throws IOException {
return apply(CharBuffer.wrap(jp, source), cacheScope);
} | [
"public",
"String",
"apply",
"(",
"final",
"JsonParser",
"jp",
",",
"CacheScope",
"cacheScope",
",",
"Supplier",
"<",
"String",
">",
"source",
")",
"throws",
"IOException",
"{",
"return",
"apply",
"(",
"CharBuffer",
".",
"wrap",
"(",
"jp",
",",
"source",
"... | returns a String read from the JsonParser argument's current position.
The returned value may be interned at the given cacheScope to reduce heap
consumption
@param jp
@param cacheScope
@return a possibly interned String
@throws IOException | [
"returns",
"a",
"String",
"read",
"from",
"the",
"JsonParser",
"argument",
"s",
"current",
"position",
".",
"The",
"returned",
"value",
"may",
"be",
"interned",
"at",
"the",
"given",
"cacheScope",
"to",
"reduce",
"heap",
"consumption"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L209-L211 |
126,068 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(CharBuffer charValue, CacheScope cacheScope) {
int keyLength = charValue.length();
if ((lengthLimit < 0 || keyLength <= lengthLimit)) {
Map<CharBuffer, String> cache = (cacheScope == CacheScope.GLOBAL_SCOPE) ? globalCache : applicationCache;
String value = cac... | java | public String apply(CharBuffer charValue, CacheScope cacheScope) {
int keyLength = charValue.length();
if ((lengthLimit < 0 || keyLength <= lengthLimit)) {
Map<CharBuffer, String> cache = (cacheScope == CacheScope.GLOBAL_SCOPE) ? globalCache : applicationCache;
String value = cac... | [
"public",
"String",
"apply",
"(",
"CharBuffer",
"charValue",
",",
"CacheScope",
"cacheScope",
")",
"{",
"int",
"keyLength",
"=",
"charValue",
".",
"length",
"(",
")",
";",
"if",
"(",
"(",
"lengthLimit",
"<",
"0",
"||",
"keyLength",
"<=",
"lengthLimit",
")"... | returns a object of type T that may be interned at the specified scope to
reduce heap consumption
@param charValue
@param cacheScope
@param trabsform
@return a possibly interned instance of T | [
"returns",
"a",
"object",
"of",
"type",
"T",
"that",
"may",
"be",
"interned",
"at",
"the",
"specified",
"scope",
"to",
"reduce",
"heap",
"consumption"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L233-L248 |
126,069 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(final String stringValue, CacheScope cacheScope) {
if (stringValue != null && (lengthLimit < 0 || stringValue.length() <= lengthLimit)) {
return (String) (cacheScope == CacheScope.GLOBAL_SCOPE ? globalCache : applicationCache)
.computeIfAbsent(CharBuffer.wrap(... | java | public String apply(final String stringValue, CacheScope cacheScope) {
if (stringValue != null && (lengthLimit < 0 || stringValue.length() <= lengthLimit)) {
return (String) (cacheScope == CacheScope.GLOBAL_SCOPE ? globalCache : applicationCache)
.computeIfAbsent(CharBuffer.wrap(... | [
"public",
"String",
"apply",
"(",
"final",
"String",
"stringValue",
",",
"CacheScope",
"cacheScope",
")",
"{",
"if",
"(",
"stringValue",
"!=",
"null",
"&&",
"(",
"lengthLimit",
"<",
"0",
"||",
"stringValue",
".",
"length",
"(",
")",
"<=",
"lengthLimit",
")... | returns a String that may be interned at the given scope to reduce heap
consumption
@param stringValue
@param cacheScope
@return a possibly interned String | [
"returns",
"a",
"String",
"that",
"may",
"be",
"interned",
"at",
"the",
"given",
"scope",
"to",
"reduce",
"heap",
"consumption"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L270-L279 |
126,070 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/ApplicationResource.java | ApplicationResource.getInstanceInfo | @Path("{id}")
public InstanceResource getInstanceInfo(@PathParam("id") String id) {
return new InstanceResource(this, id, serverConfig, registry);
} | java | @Path("{id}")
public InstanceResource getInstanceInfo(@PathParam("id") String id) {
return new InstanceResource(this, id, serverConfig, registry);
} | [
"@",
"Path",
"(",
"\"{id}\"",
")",
"public",
"InstanceResource",
"getInstanceInfo",
"(",
"@",
"PathParam",
"(",
"\"id\"",
")",
"String",
"id",
")",
"{",
"return",
"new",
"InstanceResource",
"(",
"this",
",",
"id",
",",
"serverConfig",
",",
"registry",
")",
... | Gets information about a particular instance of an application.
@param id
the unique identifier of the instance.
@return information about a particular instance. | [
"Gets",
"information",
"about",
"a",
"particular",
"instance",
"of",
"an",
"application",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/ApplicationResource.java#L127-L130 |
126,071 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.getGZIP | public byte[] getGZIP(Key key) {
Value payload = getValue(key, shouldUseReadOnlyResponseCache);
if (payload == null) {
return null;
}
return payload.getGzipped();
} | java | public byte[] getGZIP(Key key) {
Value payload = getValue(key, shouldUseReadOnlyResponseCache);
if (payload == null) {
return null;
}
return payload.getGzipped();
} | [
"public",
"byte",
"[",
"]",
"getGZIP",
"(",
"Key",
"key",
")",
"{",
"Value",
"payload",
"=",
"getValue",
"(",
"key",
",",
"shouldUseReadOnlyResponseCache",
")",
";",
"if",
"(",
"payload",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"p... | Get the compressed information about the applications.
@param key
the key for which the compressed cached information needs to
be obtained.
@return compressed payload which contains information about the
applications. | [
"Get",
"the",
"compressed",
"information",
"about",
"the",
"applications",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L229-L235 |
126,072 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.invalidate | public void invalidate(Key... keys) {
for (Key key : keys) {
logger.debug("Invalidating the response cache key : {} {} {} {}, {}",
key.getEntityType(), key.getName(), key.getVersion(), key.getType(), key.getEurekaAccept());
readWriteCacheMap.invalidate(key);
... | java | public void invalidate(Key... keys) {
for (Key key : keys) {
logger.debug("Invalidating the response cache key : {} {} {} {}, {}",
key.getEntityType(), key.getName(), key.getVersion(), key.getType(), key.getEurekaAccept());
readWriteCacheMap.invalidate(key);
... | [
"public",
"void",
"invalidate",
"(",
"Key",
"...",
"keys",
")",
"{",
"for",
"(",
"Key",
"key",
":",
"keys",
")",
"{",
"logger",
".",
"debug",
"(",
"\"Invalidating the response cache key : {} {} {} {}, {}\"",
",",
"key",
".",
"getEntityType",
"(",
")",
",",
"... | Invalidate the cache information given the list of keys.
@param keys the list of keys for which the cache information needs to be invalidated. | [
"Invalidate",
"the",
"cache",
"information",
"given",
"the",
"list",
"of",
"keys",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L269-L284 |
126,073 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.getPayLoad | private String getPayLoad(Key key, Applications apps) {
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
String result;
try {
result = encoderWrapper.encode(apps);
} catch (Exception e) {
logger.error("Failed to encode... | java | private String getPayLoad(Key key, Applications apps) {
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
String result;
try {
result = encoderWrapper.encode(apps);
} catch (Exception e) {
logger.error("Failed to encode... | [
"private",
"String",
"getPayLoad",
"(",
"Key",
"key",
",",
"Applications",
"apps",
")",
"{",
"EncoderWrapper",
"encoderWrapper",
"=",
"serverCodecs",
".",
"getEncoder",
"(",
"key",
".",
"getType",
"(",
")",
",",
"key",
".",
"getEurekaAccept",
"(",
")",
")",
... | Generate pay load with both JSON and XML formats for all applications. | [
"Generate",
"pay",
"load",
"with",
"both",
"JSON",
"and",
"XML",
"formats",
"for",
"all",
"applications",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L367-L380 |
126,074 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java | ResponseCacheImpl.getPayLoad | private String getPayLoad(Key key, Application app) {
if (app == null) {
return EMPTY_PAYLOAD;
}
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
try {
return encoderWrapper.encode(app);
} catch (Exception e) ... | java | private String getPayLoad(Key key, Application app) {
if (app == null) {
return EMPTY_PAYLOAD;
}
EncoderWrapper encoderWrapper = serverCodecs.getEncoder(key.getType(), key.getEurekaAccept());
try {
return encoderWrapper.encode(app);
} catch (Exception e) ... | [
"private",
"String",
"getPayLoad",
"(",
"Key",
"key",
",",
"Application",
"app",
")",
"{",
"if",
"(",
"app",
"==",
"null",
")",
"{",
"return",
"EMPTY_PAYLOAD",
";",
"}",
"EncoderWrapper",
"encoderWrapper",
"=",
"serverCodecs",
".",
"getEncoder",
"(",
"key",
... | Generate pay load with both JSON and XML formats for a given application. | [
"Generate",
"pay",
"load",
"with",
"both",
"JSON",
"and",
"XML",
"formats",
"for",
"a",
"given",
"application",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/registry/ResponseCacheImpl.java#L385-L397 |
126,075 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java | PeerEurekaNode.cancel | public void cancel(final String appName, final String id) throws Exception {
long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
batchingDispatcher.process(
taskId("cancel", appName, id),
new InstanceReplicationTask(targetHost, Action.Cancel, appName, id)... | java | public void cancel(final String appName, final String id) throws Exception {
long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
batchingDispatcher.process(
taskId("cancel", appName, id),
new InstanceReplicationTask(targetHost, Action.Cancel, appName, id)... | [
"public",
"void",
"cancel",
"(",
"final",
"String",
"appName",
",",
"final",
"String",
"id",
")",
"throws",
"Exception",
"{",
"long",
"expiryTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"maxProcessingDelayMs",
";",
"batchingDispatcher",
".",
... | Send the cancellation information of an instance to the node represented
by this class.
@param appName
the application name of the instance.
@param id
the unique identifier of the instance.
@throws Exception | [
"Send",
"the",
"cancellation",
"information",
"of",
"an",
"instance",
"to",
"the",
"node",
"represented",
"by",
"this",
"class",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java#L157-L177 |
126,076 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java | PeerEurekaNode.heartbeat | public void heartbeat(final String appName, final String id,
final InstanceInfo info, final InstanceStatus overriddenStatus,
boolean primeConnection) throws Throwable {
if (primeConnection) {
// We do not care about the result for priming request.
... | java | public void heartbeat(final String appName, final String id,
final InstanceInfo info, final InstanceStatus overriddenStatus,
boolean primeConnection) throws Throwable {
if (primeConnection) {
// We do not care about the result for priming request.
... | [
"public",
"void",
"heartbeat",
"(",
"final",
"String",
"appName",
",",
"final",
"String",
"id",
",",
"final",
"InstanceInfo",
"info",
",",
"final",
"InstanceStatus",
"overriddenStatus",
",",
"boolean",
"primeConnection",
")",
"throws",
"Throwable",
"{",
"if",
"(... | Send the heartbeat information of an instance to the node represented by
this class. If the instance does not exist the node, the instance
registration information is sent again to the peer node.
@param appName
the application name of the instance.
@param id
the unique identifier of the instance.
@param info
the insta... | [
"Send",
"the",
"heartbeat",
"information",
"of",
"an",
"instance",
"to",
"the",
"node",
"represented",
"by",
"this",
"class",
".",
"If",
"the",
"instance",
"does",
"not",
"exist",
"the",
"node",
"the",
"instance",
"registration",
"information",
"is",
"sent",
... | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java#L194-L228 |
126,077 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java | PeerEurekaNode.statusUpdate | public void statusUpdate(final String asgName, final ASGStatus newStatus) {
long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
nonBatchingDispatcher.process(
asgName,
new AsgReplicationTask(targetHost, Action.StatusUpdate, asgName, newStatus) {
... | java | public void statusUpdate(final String asgName, final ASGStatus newStatus) {
long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
nonBatchingDispatcher.process(
asgName,
new AsgReplicationTask(targetHost, Action.StatusUpdate, asgName, newStatus) {
... | [
"public",
"void",
"statusUpdate",
"(",
"final",
"String",
"asgName",
",",
"final",
"ASGStatus",
"newStatus",
")",
"{",
"long",
"expiryTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"maxProcessingDelayMs",
";",
"nonBatchingDispatcher",
".",
"process... | Send the status information of of the ASG represented by the instance.
<p>
ASG (Autoscaling group) names are available for instances in AWS and the
ASG information is used for determining if the instance should be
registered as {@link InstanceStatus#DOWN} or {@link InstanceStatus#UP}.
@param asgName
the asg name if a... | [
"Send",
"the",
"status",
"information",
"of",
"of",
"the",
"ASG",
"represented",
"by",
"the",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java#L243-L254 |
126,078 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java | PeerEurekaNode.deleteStatusOverride | public void deleteStatusOverride(final String appName, final String id, final InstanceInfo info) {
long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
batchingDispatcher.process(
taskId("deleteStatusOverride", appName, id),
new InstanceReplicationTask(tar... | java | public void deleteStatusOverride(final String appName, final String id, final InstanceInfo info) {
long expiryTime = System.currentTimeMillis() + maxProcessingDelayMs;
batchingDispatcher.process(
taskId("deleteStatusOverride", appName, id),
new InstanceReplicationTask(tar... | [
"public",
"void",
"deleteStatusOverride",
"(",
"final",
"String",
"appName",
",",
"final",
"String",
"id",
",",
"final",
"InstanceInfo",
"info",
")",
"{",
"long",
"expiryTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
"+",
"maxProcessingDelayMs",
";",
... | Delete instance status override.
@param appName
the application name of the instance.
@param id
the unique identifier of the instance.
@param info
the instance information of the instance. | [
"Delete",
"instance",
"status",
"override",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/PeerEurekaNode.java#L294-L305 |
126,079 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java | InstanceResource.renewLease | @PUT
public Response renewLease(
@HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication,
@QueryParam("overriddenstatus") String overriddenStatus,
@QueryParam("status") String status,
@QueryParam("lastDirtyTimestamp") String lastDirtyTimestamp) {
... | java | @PUT
public Response renewLease(
@HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication,
@QueryParam("overriddenstatus") String overriddenStatus,
@QueryParam("status") String status,
@QueryParam("lastDirtyTimestamp") String lastDirtyTimestamp) {
... | [
"@",
"PUT",
"public",
"Response",
"renewLease",
"(",
"@",
"HeaderParam",
"(",
"PeerEurekaNode",
".",
"HEADER_REPLICATION",
")",
"String",
"isReplication",
",",
"@",
"QueryParam",
"(",
"\"overriddenstatus\"",
")",
"String",
"overriddenStatus",
",",
"@",
"QueryParam",... | A put request for renewing lease from a client instance.
@param isReplication
a header parameter containing information whether this is
replicated from other nodes.
@param overriddenStatus
overridden status if any.
@param status
the {@link InstanceStatus} of the instance.
@param lastDirtyTimestamp
last timestamp when ... | [
"A",
"put",
"request",
"for",
"renewing",
"lease",
"from",
"a",
"client",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java#L105-L136 |
126,080 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java | InstanceResource.cancelLease | @DELETE
public Response cancelLease(
@HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) {
try {
boolean isSuccess = registry.cancel(app.getName(), id,
"true".equals(isReplication));
if (isSuccess) {
logger.debug("Found (... | java | @DELETE
public Response cancelLease(
@HeaderParam(PeerEurekaNode.HEADER_REPLICATION) String isReplication) {
try {
boolean isSuccess = registry.cancel(app.getName(), id,
"true".equals(isReplication));
if (isSuccess) {
logger.debug("Found (... | [
"@",
"DELETE",
"public",
"Response",
"cancelLease",
"(",
"@",
"HeaderParam",
"(",
"PeerEurekaNode",
".",
"HEADER_REPLICATION",
")",
"String",
"isReplication",
")",
"{",
"try",
"{",
"boolean",
"isSuccess",
"=",
"registry",
".",
"cancel",
"(",
"app",
".",
"getNa... | Handles cancellation of leases for this particular instance.
@param isReplication
a header parameter containing information whether this is
replicated from other nodes.
@return response indicating whether the operation was a success or
failure. | [
"Handles",
"cancellation",
"of",
"leases",
"for",
"this",
"particular",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java#L277-L296 |
126,081 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/EurekaUtils.java | EurekaUtils.getPrivateIp | public static String getPrivateIp(InstanceInfo instanceInfo) {
String defaultPrivateIp = null;
if (instanceInfo.getDataCenterInfo() instanceof AmazonInfo) {
defaultPrivateIp = ((AmazonInfo) instanceInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.localIpv4);
}
if (isNull... | java | public static String getPrivateIp(InstanceInfo instanceInfo) {
String defaultPrivateIp = null;
if (instanceInfo.getDataCenterInfo() instanceof AmazonInfo) {
defaultPrivateIp = ((AmazonInfo) instanceInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.localIpv4);
}
if (isNull... | [
"public",
"static",
"String",
"getPrivateIp",
"(",
"InstanceInfo",
"instanceInfo",
")",
"{",
"String",
"defaultPrivateIp",
"=",
"null",
";",
"if",
"(",
"instanceInfo",
".",
"getDataCenterInfo",
"(",
")",
"instanceof",
"AmazonInfo",
")",
"{",
"defaultPrivateIp",
"=... | return the privateIp address of the given InstanceInfo record. The record could be for the local server
or a remote server.
@param instanceInfo
@return the private Ip (also known as localIpv4 in ec2) | [
"return",
"the",
"privateIp",
"address",
"of",
"the",
"given",
"InstanceInfo",
"record",
".",
"The",
"record",
"could",
"be",
"for",
"the",
"local",
"server",
"or",
"a",
"remote",
"server",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/EurekaUtils.java#L22-L34 |
126,082 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.isASGEnabled | public boolean isASGEnabled(InstanceInfo instanceInfo) {
CacheKey cacheKey = new CacheKey(getAccountId(instanceInfo, accountId), instanceInfo.getASGName());
Boolean result = asgCache.getIfPresent(cacheKey);
if (result != null) {
return result;
} else {
if (!server... | java | public boolean isASGEnabled(InstanceInfo instanceInfo) {
CacheKey cacheKey = new CacheKey(getAccountId(instanceInfo, accountId), instanceInfo.getASGName());
Boolean result = asgCache.getIfPresent(cacheKey);
if (result != null) {
return result;
} else {
if (!server... | [
"public",
"boolean",
"isASGEnabled",
"(",
"InstanceInfo",
"instanceInfo",
")",
"{",
"CacheKey",
"cacheKey",
"=",
"new",
"CacheKey",
"(",
"getAccountId",
"(",
"instanceInfo",
",",
"accountId",
")",
",",
"instanceInfo",
".",
"getASGName",
"(",
")",
")",
";",
"Bo... | Return the status of the ASG whether is enabled or disabled for service.
The value is picked up from the cache except the very first time.
@param instanceInfo the instanceInfo for the lookup
@return true if enabled, false otherwise | [
"Return",
"the",
"status",
"of",
"the",
"ASG",
"whether",
"is",
"enabled",
"or",
"disabled",
"for",
"service",
".",
"The",
"value",
"is",
"picked",
"up",
"from",
"the",
"cache",
"except",
"the",
"very",
"first",
"time",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L162-L185 |
126,083 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.setStatus | public void setStatus(String asgName, boolean enabled) {
String asgAccountId = getASGAccount(asgName);
asgCache.put(new CacheKey(asgAccountId, asgName), enabled);
} | java | public void setStatus(String asgName, boolean enabled) {
String asgAccountId = getASGAccount(asgName);
asgCache.put(new CacheKey(asgAccountId, asgName), enabled);
} | [
"public",
"void",
"setStatus",
"(",
"String",
"asgName",
",",
"boolean",
"enabled",
")",
"{",
"String",
"asgAccountId",
"=",
"getASGAccount",
"(",
"asgName",
")",
";",
"asgCache",
".",
"put",
"(",
"new",
"CacheKey",
"(",
"asgAccountId",
",",
"asgName",
")",
... | Sets the status of the ASG.
@param asgName The name of the ASG
@param enabled true to enable, false to disable | [
"Sets",
"the",
"status",
"of",
"the",
"ASG",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L193-L196 |
126,084 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.isAddToLoadBalancerSuspended | private boolean isAddToLoadBalancerSuspended(String asgAccountId, String asgName) {
AutoScalingGroup asg;
if(asgAccountId == null || asgAccountId.equals(accountId)) {
asg = retrieveAutoScalingGroup(asgName);
} else {
asg = retrieveAutoScalingGroupCrossAccount(asgAccountId... | java | private boolean isAddToLoadBalancerSuspended(String asgAccountId, String asgName) {
AutoScalingGroup asg;
if(asgAccountId == null || asgAccountId.equals(accountId)) {
asg = retrieveAutoScalingGroup(asgName);
} else {
asg = retrieveAutoScalingGroupCrossAccount(asgAccountId... | [
"private",
"boolean",
"isAddToLoadBalancerSuspended",
"(",
"String",
"asgAccountId",
",",
"String",
"asgName",
")",
"{",
"AutoScalingGroup",
"asg",
";",
"if",
"(",
"asgAccountId",
"==",
"null",
"||",
"asgAccountId",
".",
"equals",
"(",
"accountId",
")",
")",
"{"... | Check if the ASG is disabled. The amazon flag "AddToLoadBalancer" is
queried to figure out if it is or not.
@param asgName
- The name of the ASG for which the status needs to be queried
@return - true if the ASG is disabled, false otherwise | [
"Check",
"if",
"the",
"ASG",
"is",
"disabled",
".",
"The",
"amazon",
"flag",
"AddToLoadBalancer",
"is",
"queried",
"to",
"figure",
"out",
"if",
"it",
"is",
"or",
"not",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L206-L218 |
126,085 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.isAddToLoadBalancerSuspended | private boolean isAddToLoadBalancerSuspended(AutoScalingGroup asg) {
List<SuspendedProcess> suspendedProcesses = asg.getSuspendedProcesses();
for (SuspendedProcess process : suspendedProcesses) {
if (PROP_ADD_TO_LOAD_BALANCER.equals(process.getProcessName())) {
return true;
... | java | private boolean isAddToLoadBalancerSuspended(AutoScalingGroup asg) {
List<SuspendedProcess> suspendedProcesses = asg.getSuspendedProcesses();
for (SuspendedProcess process : suspendedProcesses) {
if (PROP_ADD_TO_LOAD_BALANCER.equals(process.getProcessName())) {
return true;
... | [
"private",
"boolean",
"isAddToLoadBalancerSuspended",
"(",
"AutoScalingGroup",
"asg",
")",
"{",
"List",
"<",
"SuspendedProcess",
">",
"suspendedProcesses",
"=",
"asg",
".",
"getSuspendedProcesses",
"(",
")",
";",
"for",
"(",
"SuspendedProcess",
"process",
":",
"susp... | Checks if the load balancer addition is disabled or not.
@param asg
- The ASG object for which the status needs to be checked
@return - true, if the load balancer addition is suspended, false
otherwise. | [
"Checks",
"if",
"the",
"load",
"balancer",
"addition",
"is",
"disabled",
"or",
"not",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L228-L236 |
126,086 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.retrieveAutoScalingGroup | private AutoScalingGroup retrieveAutoScalingGroup(String asgName) {
if (Strings.isNullOrEmpty(asgName)) {
logger.warn("null asgName specified, not attempting to retrieve AutoScalingGroup from AWS");
return null;
}
// You can pass one name or a list of names in the request... | java | private AutoScalingGroup retrieveAutoScalingGroup(String asgName) {
if (Strings.isNullOrEmpty(asgName)) {
logger.warn("null asgName specified, not attempting to retrieve AutoScalingGroup from AWS");
return null;
}
// You can pass one name or a list of names in the request... | [
"private",
"AutoScalingGroup",
"retrieveAutoScalingGroup",
"(",
"String",
"asgName",
")",
"{",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"asgName",
")",
")",
"{",
"logger",
".",
"warn",
"(",
"\"null asgName specified, not attempting to retrieve AutoScalingGroup fro... | Queries AWS to get the autoscaling information given the asgName.
@param asgName
- The name of the ASG.
@return - The auto scaling group information. | [
"Queries",
"AWS",
"to",
"get",
"the",
"autoscaling",
"information",
"given",
"the",
"asgName",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L245-L261 |
126,087 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.isASGEnabledinAWS | private Boolean isASGEnabledinAWS(String asgAccountid, String asgName) {
try {
Stopwatch t = this.loadASGInfoTimer.start();
boolean returnValue = !isAddToLoadBalancerSuspended(asgAccountid, asgName);
t.stop();
return returnValue;
} catch (Throwable e) {
... | java | private Boolean isASGEnabledinAWS(String asgAccountid, String asgName) {
try {
Stopwatch t = this.loadASGInfoTimer.start();
boolean returnValue = !isAddToLoadBalancerSuspended(asgAccountid, asgName);
t.stop();
return returnValue;
} catch (Throwable e) {
... | [
"private",
"Boolean",
"isASGEnabledinAWS",
"(",
"String",
"asgAccountid",
",",
"String",
"asgName",
")",
"{",
"try",
"{",
"Stopwatch",
"t",
"=",
"this",
".",
"loadASGInfoTimer",
".",
"start",
"(",
")",
";",
"boolean",
"returnValue",
"=",
"!",
"isAddToLoadBalan... | Queries AWS to see if the load balancer flag is suspended.
@param asgAccountid the accountId this asg resides in, if applicable (null will use the default accountId)
@param asgName the name of the asg
@return true, if the load balancer flag is not suspended, false otherwise. | [
"Queries",
"AWS",
"to",
"see",
"if",
"the",
"load",
"balancer",
"flag",
"is",
"suspended",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L326-L336 |
126,088 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.getNumberofElementsinASGCache | @com.netflix.servo.annotations.Monitor(name = "numOfElementsinASGCache",
description = "Number of elements in the ASG Cache", type = DataSourceType.GAUGE)
public long getNumberofElementsinASGCache() {
return asgCache.size();
} | java | @com.netflix.servo.annotations.Monitor(name = "numOfElementsinASGCache",
description = "Number of elements in the ASG Cache", type = DataSourceType.GAUGE)
public long getNumberofElementsinASGCache() {
return asgCache.size();
} | [
"@",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"Monitor",
"(",
"name",
"=",
"\"numOfElementsinASGCache\"",
",",
"description",
"=",
"\"Number of elements in the ASG Cache\"",
",",
"type",
"=",
"DataSourceType",
".",
"GAUGE",
")",
"public",
"lon... | Gets the number of elements in the ASG cache.
@return the long value representing the number of elements in the ASG
cache. | [
"Gets",
"the",
"number",
"of",
"elements",
"in",
"the",
"ASG",
"cache",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L344-L348 |
126,089 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.getNumberofASGQueries | @com.netflix.servo.annotations.Monitor(name = "numOfASGQueries",
description = "Number of queries made to AWS to retrieve ASG information", type = DataSourceType.COUNTER)
public long getNumberofASGQueries() {
return asgCache.stats().loadCount();
} | java | @com.netflix.servo.annotations.Monitor(name = "numOfASGQueries",
description = "Number of queries made to AWS to retrieve ASG information", type = DataSourceType.COUNTER)
public long getNumberofASGQueries() {
return asgCache.stats().loadCount();
} | [
"@",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"Monitor",
"(",
"name",
"=",
"\"numOfASGQueries\"",
",",
"description",
"=",
"\"Number of queries made to AWS to retrieve ASG information\"",
",",
"type",
"=",
"DataSourceType",
".",
"COUNTER",
")",
... | Gets the number of ASG queries done in the period.
@return the long value representing the number of ASG queries done in the
period. | [
"Gets",
"the",
"number",
"of",
"ASG",
"queries",
"done",
"in",
"the",
"period",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L356-L360 |
126,090 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.getNumberofASGQueryFailures | @com.netflix.servo.annotations.Monitor(name = "numOfASGQueryFailures",
description = "Number of queries made to AWS to retrieve ASG information and that failed",
type = DataSourceType.COUNTER)
public long getNumberofASGQueryFailures() {
return asgCache.stats().loadExceptionCount();
... | java | @com.netflix.servo.annotations.Monitor(name = "numOfASGQueryFailures",
description = "Number of queries made to AWS to retrieve ASG information and that failed",
type = DataSourceType.COUNTER)
public long getNumberofASGQueryFailures() {
return asgCache.stats().loadExceptionCount();
... | [
"@",
"com",
".",
"netflix",
".",
"servo",
".",
"annotations",
".",
"Monitor",
"(",
"name",
"=",
"\"numOfASGQueryFailures\"",
",",
"description",
"=",
"\"Number of queries made to AWS to retrieve ASG information and that failed\"",
",",
"type",
"=",
"DataSourceType",
".",
... | Gets the number of ASG queries that failed because of some reason.
@return the long value representing the number of ASG queries that failed
because of some reason. | [
"Gets",
"the",
"number",
"of",
"ASG",
"queries",
"that",
"failed",
"because",
"of",
"some",
"reason",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L368-L373 |
126,091 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.getASGUpdateTask | private TimerTask getASGUpdateTask() {
return new TimerTask() {
@Override
public void run() {
try {
if (!serverConfig.shouldUseAwsAsgApi()) {
// Disabled via the config, no-op.
return;
... | java | private TimerTask getASGUpdateTask() {
return new TimerTask() {
@Override
public void run() {
try {
if (!serverConfig.shouldUseAwsAsgApi()) {
// Disabled via the config, no-op.
return;
... | [
"private",
"TimerTask",
"getASGUpdateTask",
"(",
")",
"{",
"return",
"new",
"TimerTask",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"!",
"serverConfig",
".",
"shouldUseAwsAsgApi",
"(",
")",
")",
"{",
... | Gets the task that updates the ASG information periodically.
@return TimerTask that updates the ASG information periodically. | [
"Gets",
"the",
"task",
"that",
"updates",
"the",
"ASG",
"information",
"periodically",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L380-L412 |
126,092 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java | AwsAsgUtil.getCacheKeys | private Set<CacheKey> getCacheKeys() {
Set<CacheKey> cacheKeys = new HashSet<CacheKey>();
Applications apps = registry.getApplicationsFromLocalRegionOnly();
for (Application app : apps.getRegisteredApplications()) {
for (InstanceInfo instanceInfo : app.getInstances()) {
... | java | private Set<CacheKey> getCacheKeys() {
Set<CacheKey> cacheKeys = new HashSet<CacheKey>();
Applications apps = registry.getApplicationsFromLocalRegionOnly();
for (Application app : apps.getRegisteredApplications()) {
for (InstanceInfo instanceInfo : app.getInstances()) {
... | [
"private",
"Set",
"<",
"CacheKey",
">",
"getCacheKeys",
"(",
")",
"{",
"Set",
"<",
"CacheKey",
">",
"cacheKeys",
"=",
"new",
"HashSet",
"<",
"CacheKey",
">",
"(",
")",
";",
"Applications",
"apps",
"=",
"registry",
".",
"getApplicationsFromLocalRegionOnly",
"... | Get the cacheKeys of all the ASG to which query AWS for.
<p>
The names are obtained from the {@link com.netflix.eureka.registry.InstanceRegistry} which is then
used for querying the AWS.
</p>
@return the set of ASG cacheKeys (asgName + accountId). | [
"Get",
"the",
"cacheKeys",
"of",
"all",
"the",
"ASG",
"to",
"which",
"query",
"AWS",
"for",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/AwsAsgUtil.java#L424-L439 |
126,093 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/cluster/ReplicationTaskProcessor.java | ReplicationTaskProcessor.maybeReadTimeOut | private static boolean maybeReadTimeOut(Throwable e) {
do {
if (IOException.class.isInstance(e)) {
String message = e.getMessage().toLowerCase();
Matcher matcher = READ_TIME_OUT_PATTERN.matcher(message);
if(matcher.find()) {
return true;
... | java | private static boolean maybeReadTimeOut(Throwable e) {
do {
if (IOException.class.isInstance(e)) {
String message = e.getMessage().toLowerCase();
Matcher matcher = READ_TIME_OUT_PATTERN.matcher(message);
if(matcher.find()) {
return true;
... | [
"private",
"static",
"boolean",
"maybeReadTimeOut",
"(",
"Throwable",
"e",
")",
"{",
"do",
"{",
"if",
"(",
"IOException",
".",
"class",
".",
"isInstance",
"(",
"e",
")",
")",
"{",
"String",
"message",
"=",
"e",
".",
"getMessage",
"(",
")",
".",
"toLowe... | Check if the exception is socket read time out exception
@param e
The exception for which the information needs to be found.
@return true, if it may be a socket read time out exception. | [
"Check",
"if",
"the",
"exception",
"is",
"socket",
"read",
"time",
"out",
"exception"
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/cluster/ReplicationTaskProcessor.java#L193-L205 |
126,094 | Netflix/eureka | eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java | ApplicationInfoManager.setInstanceStatus | public synchronized void setInstanceStatus(InstanceStatus status) {
InstanceStatus next = instanceStatusMapper.map(status);
if (next == null) {
return;
}
InstanceStatus prev = instanceInfo.setStatus(next);
if (prev != null) {
for (StatusChangeListener lis... | java | public synchronized void setInstanceStatus(InstanceStatus status) {
InstanceStatus next = instanceStatusMapper.map(status);
if (next == null) {
return;
}
InstanceStatus prev = instanceInfo.setStatus(next);
if (prev != null) {
for (StatusChangeListener lis... | [
"public",
"synchronized",
"void",
"setInstanceStatus",
"(",
"InstanceStatus",
"status",
")",
"{",
"InstanceStatus",
"next",
"=",
"instanceStatusMapper",
".",
"map",
"(",
"status",
")",
";",
"if",
"(",
"next",
"==",
"null",
")",
"{",
"return",
";",
"}",
"Inst... | Set the status of this instance. Application can use this to indicate
whether it is ready to receive traffic. Setting the status here also notifies all registered listeners
of a status change event.
@param status Status of the instance | [
"Set",
"the",
"status",
"of",
"this",
"instance",
".",
"Application",
"can",
"use",
"this",
"to",
"indicate",
"whether",
"it",
"is",
"ready",
"to",
"receive",
"traffic",
".",
"Setting",
"the",
"status",
"here",
"also",
"notifies",
"all",
"registered",
"liste... | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java#L167-L183 |
126,095 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/ElasticNetworkInterfaceBinder.java | ElasticNetworkInterfaceBinder.bind | public void bind() throws MalformedURLException {
InstanceInfo myInfo = ApplicationInfoManager.getInstance().getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo... | java | public void bind() throws MalformedURLException {
InstanceInfo myInfo = ApplicationInfoManager.getInstance().getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.instanceId);
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo... | [
"public",
"void",
"bind",
"(",
")",
"throws",
"MalformedURLException",
"{",
"InstanceInfo",
"myInfo",
"=",
"ApplicationInfoManager",
".",
"getInstance",
"(",
")",
".",
"getInfo",
"(",
")",
";",
"String",
"myInstanceId",
"=",
"(",
"(",
"AmazonInfo",
")",
"myInf... | Binds an ENI to the instance.
The candidate ENI's are deduced in the same wa the EIP binder works: Via dns records or via service urls,
depending on configuration.
It will try to attach the first ENI that is:
Available
For this subnet
In the list of candidate ENI's
@throws MalformedURLException | [
"Binds",
"an",
"ENI",
"to",
"the",
"instance",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/ElasticNetworkInterfaceBinder.java#L156-L189 |
126,096 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/ElasticNetworkInterfaceBinder.java | ElasticNetworkInterfaceBinder.unbind | public void unbind() throws Exception {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.instanceId);
AmazonEC2 ec2 = getEC2Service();
List<InstanceNetworkInterface> result = instanceData(... | java | public void unbind() throws Exception {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myInstanceId = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.instanceId);
AmazonEC2 ec2 = getEC2Service();
List<InstanceNetworkInterface> result = instanceData(... | [
"public",
"void",
"unbind",
"(",
")",
"throws",
"Exception",
"{",
"InstanceInfo",
"myInfo",
"=",
"applicationInfoManager",
".",
"getInfo",
"(",
")",
";",
"String",
"myInstanceId",
"=",
"(",
"(",
"AmazonInfo",
")",
"myInfo",
".",
"getDataCenterInfo",
"(",
")",
... | Unbind the IP that this instance is associated with. | [
"Unbind",
"the",
"IP",
"that",
"this",
"instance",
"is",
"associated",
"with",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/ElasticNetworkInterfaceBinder.java#L194-L211 |
126,097 | Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/aws/ElasticNetworkInterfaceBinder.java | ElasticNetworkInterfaceBinder.getCandidateIps | public List<String> getCandidateIps() throws MalformedURLException {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.availabilityZone);
Collection<String> candidates = clientConfig.shouldUseDnsForFetchi... | java | public List<String> getCandidateIps() throws MalformedURLException {
InstanceInfo myInfo = applicationInfoManager.getInfo();
String myZone = ((AmazonInfo) myInfo.getDataCenterInfo()).get(AmazonInfo.MetaDataKey.availabilityZone);
Collection<String> candidates = clientConfig.shouldUseDnsForFetchi... | [
"public",
"List",
"<",
"String",
">",
"getCandidateIps",
"(",
")",
"throws",
"MalformedURLException",
"{",
"InstanceInfo",
"myInfo",
"=",
"applicationInfoManager",
".",
"getInfo",
"(",
")",
";",
"String",
"myZone",
"=",
"(",
"(",
"AmazonInfo",
")",
"myInfo",
"... | Based on shouldUseDnsForFetchingServiceUrls configuration, either retrieves candidates from dns records or from
configuration properties. | [
"Based",
"on",
"shouldUseDnsForFetchingServiceUrls",
"configuration",
"either",
"retrieves",
"candidates",
"from",
"dns",
"records",
"or",
"from",
"configuration",
"properties",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/aws/ElasticNetworkInterfaceBinder.java#L223-L255 |
126,098 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java | Applications.populateInstanceCountMap | public void populateInstanceCountMap(Map<String, AtomicInteger> instanceCountMap) {
for (Application app : this.getRegisteredApplications()) {
for (InstanceInfo info : app.getInstancesAsIsFromEureka()) {
AtomicInteger instanceCount = instanceCountMap.computeIfAbsent(info.getStatus().... | java | public void populateInstanceCountMap(Map<String, AtomicInteger> instanceCountMap) {
for (Application app : this.getRegisteredApplications()) {
for (InstanceInfo info : app.getInstancesAsIsFromEureka()) {
AtomicInteger instanceCount = instanceCountMap.computeIfAbsent(info.getStatus().... | [
"public",
"void",
"populateInstanceCountMap",
"(",
"Map",
"<",
"String",
",",
"AtomicInteger",
">",
"instanceCountMap",
")",
"{",
"for",
"(",
"Application",
"app",
":",
"this",
".",
"getRegisteredApplications",
"(",
")",
")",
"{",
"for",
"(",
"InstanceInfo",
"... | Populates the provided instance count map. The instance count map is used
as part of the general app list synchronization mechanism.
@param instanceCountMap
the map to populate | [
"Populates",
"the",
"provided",
"instance",
"count",
"map",
".",
"The",
"instance",
"count",
"map",
"is",
"used",
"as",
"part",
"of",
"the",
"general",
"app",
"list",
"synchronization",
"mechanism",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java#L246-L254 |
126,099 | Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java | Applications.getReconcileHashCode | public static String getReconcileHashCode(Map<String, AtomicInteger> instanceCountMap) {
StringBuilder reconcileHashCode = new StringBuilder(75);
for (Map.Entry<String, AtomicInteger> mapEntry : instanceCountMap.entrySet()) {
reconcileHashCode.append(mapEntry.getKey()).append(STATUS_DELIMITE... | java | public static String getReconcileHashCode(Map<String, AtomicInteger> instanceCountMap) {
StringBuilder reconcileHashCode = new StringBuilder(75);
for (Map.Entry<String, AtomicInteger> mapEntry : instanceCountMap.entrySet()) {
reconcileHashCode.append(mapEntry.getKey()).append(STATUS_DELIMITE... | [
"public",
"static",
"String",
"getReconcileHashCode",
"(",
"Map",
"<",
"String",
",",
"AtomicInteger",
">",
"instanceCountMap",
")",
"{",
"StringBuilder",
"reconcileHashCode",
"=",
"new",
"StringBuilder",
"(",
"75",
")",
";",
"for",
"(",
"Map",
".",
"Entry",
"... | Gets the reconciliation hashcode. The hashcode is used to determine
whether the applications list has changed since the last time it was
acquired.
@param instanceCountMap
the instance count map to use for generating the hash
@return the hash code for this instance | [
"Gets",
"the",
"reconciliation",
"hashcode",
".",
"The",
"hashcode",
"is",
"used",
"to",
"determine",
"whether",
"the",
"applications",
"list",
"has",
"changed",
"since",
"the",
"last",
"time",
"it",
"was",
"acquired",
"."
] | 48446d956be09df6650a3c00b7ebd7e2d1e1544f | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/shared/Applications.java#L265-L272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.