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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
25,100 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java | LogManager.d | public static void d(String tag, String message, Object... args) {
sLogger.d(tag, message, args);
} | java | public static void d(String tag, String message, Object... args) {
sLogger.d(tag, message, args);
} | [
"public",
"static",
"void",
"d",
"(",
"String",
"tag",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"sLogger",
".",
"d",
"(",
"tag",
",",
"message",
",",
"args",
")",
";",
"}"
] | Send a debug log message to the logger.
@param tag Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.
@param message The message you would like logged. This message may contain string formatting
which will be replaced with values from args.
@param ... | [
"Send",
"a",
"debug",
"log",
"message",
"to",
"the",
"logger",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java#L111-L113 |
25,101 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java | LogManager.i | public static void i(String tag, String message, Object... args) {
sLogger.i(tag, message, args);
} | java | public static void i(String tag, String message, Object... args) {
sLogger.i(tag, message, args);
} | [
"public",
"static",
"void",
"i",
"(",
"String",
"tag",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"sLogger",
".",
"i",
"(",
"tag",
",",
"message",
",",
"args",
")",
";",
"}"
] | Send a info log message to the logger.
@param tag Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.
@param message The message you would like logged. This message may contain string formatting
which will be replaced with values from args.
@param a... | [
"Send",
"a",
"info",
"log",
"message",
"to",
"the",
"logger",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java#L138-L140 |
25,102 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java | LogManager.w | public static void w(String tag, String message, Object... args) {
sLogger.w(tag, message, args);
} | java | public static void w(String tag, String message, Object... args) {
sLogger.w(tag, message, args);
} | [
"public",
"static",
"void",
"w",
"(",
"String",
"tag",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"sLogger",
".",
"w",
"(",
"tag",
",",
"message",
",",
"args",
")",
";",
"}"
] | Send a warning log message to the logger.
@param tag Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.
@param message The message you would like logged. This message may contain string formatting
which will be replaced with values from args.
@para... | [
"Send",
"a",
"warning",
"log",
"message",
"to",
"the",
"logger",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java#L165-L167 |
25,103 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java | LogManager.e | public static void e(String tag, String message, Object... args) {
sLogger.e(tag, message, args);
} | java | public static void e(String tag, String message, Object... args) {
sLogger.e(tag, message, args);
} | [
"public",
"static",
"void",
"e",
"(",
"String",
"tag",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"sLogger",
".",
"e",
"(",
"tag",
",",
"message",
",",
"args",
")",
";",
"}"
] | Send a error log message to the logger.
@param tag Used to identify the source of a log message. It usually identifies
the class or activity where the log call occurs.
@param message The message you would like logged. This message may contain string formatting
which will be replaced with values from args.
@param ... | [
"Send",
"a",
"error",
"log",
"message",
"to",
"the",
"logger",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/logging/LogManager.java#L192-L194 |
25,104 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/BeaconService.java | BeaconService.onBind | @Override
public IBinder onBind(Intent intent) {
LogManager.i(TAG, "binding");
return mMessenger.getBinder();
} | java | @Override
public IBinder onBind(Intent intent) {
LogManager.i(TAG, "binding");
return mMessenger.getBinder();
} | [
"@",
"Override",
"public",
"IBinder",
"onBind",
"(",
"Intent",
"intent",
")",
"{",
"LogManager",
".",
"i",
"(",
"TAG",
",",
"\"binding\"",
")",
";",
"return",
"mMessenger",
".",
"getBinder",
"(",
")",
";",
"}"
] | When binding to the service, we return an interface to our messenger
for sending messages to the service. | [
"When",
"binding",
"to",
"the",
"service",
"we",
"return",
"an",
"interface",
"to",
"our",
"messenger",
"for",
"sending",
"messages",
"to",
"the",
"service",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/BeaconService.java#L307-L311 |
25,105 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/BeaconService.java | BeaconService.onUnbind | @Override
public boolean onUnbind(Intent intent) {
LogManager.i(TAG, "unbinding so destroying self");
this.stopForeground(true);
this.stopSelf();
return false;
} | java | @Override
public boolean onUnbind(Intent intent) {
LogManager.i(TAG, "unbinding so destroying self");
this.stopForeground(true);
this.stopSelf();
return false;
} | [
"@",
"Override",
"public",
"boolean",
"onUnbind",
"(",
"Intent",
"intent",
")",
"{",
"LogManager",
".",
"i",
"(",
"TAG",
",",
"\"unbinding so destroying self\"",
")",
";",
"this",
".",
"stopForeground",
"(",
"true",
")",
";",
"this",
".",
"stopSelf",
"(",
... | called when the last bound client calls unbind | [
"called",
"when",
"the",
"last",
"bound",
"client",
"calls",
"unbind"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/BeaconService.java#L314-L320 |
25,106 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/BeaconService.java | BeaconService.startRangingBeaconsInRegion | @MainThread
public void startRangingBeaconsInRegion(Region region, Callback callback) {
synchronized (mScanHelper.getRangedRegionState()) {
if (mScanHelper.getRangedRegionState().containsKey(region)) {
LogManager.i(TAG, "Already ranging that region -- will replace existing region... | java | @MainThread
public void startRangingBeaconsInRegion(Region region, Callback callback) {
synchronized (mScanHelper.getRangedRegionState()) {
if (mScanHelper.getRangedRegionState().containsKey(region)) {
LogManager.i(TAG, "Already ranging that region -- will replace existing region... | [
"@",
"MainThread",
"public",
"void",
"startRangingBeaconsInRegion",
"(",
"Region",
"region",
",",
"Callback",
"callback",
")",
"{",
"synchronized",
"(",
"mScanHelper",
".",
"getRangedRegionState",
"(",
")",
")",
"{",
"if",
"(",
"mScanHelper",
".",
"getRangedRegion... | methods for clients | [
"methods",
"for",
"clients"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/BeaconService.java#L368-L381 |
25,107 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.parse | public static Identifier parse(String stringValue, int desiredByteLength) {
if (stringValue == null) {
throw new NullPointerException("Identifiers cannot be constructed from null pointers but \"stringValue\" is null.");
}
if (HEX_PATTERN.matcher(stringValue).matches()) {
... | java | public static Identifier parse(String stringValue, int desiredByteLength) {
if (stringValue == null) {
throw new NullPointerException("Identifiers cannot be constructed from null pointers but \"stringValue\" is null.");
}
if (HEX_PATTERN.matcher(stringValue).matches()) {
... | [
"public",
"static",
"Identifier",
"parse",
"(",
"String",
"stringValue",
",",
"int",
"desiredByteLength",
")",
"{",
"if",
"(",
"stringValue",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Identifiers cannot be constructed from null pointers but... | Variant of the parse method that allows specifying the byte length of the identifier.
@see #parse(String)
@param stringValue
@param desiredByteLength
@return | [
"Variant",
"of",
"the",
"parse",
"method",
"that",
"allows",
"specifying",
"the",
"byte",
"length",
"of",
"the",
"identifier",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L66-L100 |
25,108 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.fromLong | public static Identifier fromLong(long longValue, int desiredByteLength) {
if (desiredByteLength < 0) {
throw new IllegalArgumentException("Identifier length must be > 0.");
}
byte[] newValue = new byte[desiredByteLength];
for (int i = desiredByteLength-1; i >= 0; i--) {
... | java | public static Identifier fromLong(long longValue, int desiredByteLength) {
if (desiredByteLength < 0) {
throw new IllegalArgumentException("Identifier length must be > 0.");
}
byte[] newValue = new byte[desiredByteLength];
for (int i = desiredByteLength-1; i >= 0; i--) {
... | [
"public",
"static",
"Identifier",
"fromLong",
"(",
"long",
"longValue",
",",
"int",
"desiredByteLength",
")",
"{",
"if",
"(",
"desiredByteLength",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Identifier length must be > 0.\"",
")",
";",
... | Creates an Identifer backed by an array of length desiredByteLength
@param longValue a long to put into the identifier
@param desiredByteLength how many bytes to make the identifier
@return | [
"Creates",
"an",
"Identifer",
"backed",
"by",
"an",
"array",
"of",
"length",
"desiredByteLength"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L130-L140 |
25,109 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.fromBytes | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static Identifier fromBytes(byte[] bytes, int start, int end, boolean littleEndian) {
if (bytes == null) {
throw new NullPointerException("Identifiers cannot be constructed from null pointers but \"bytes\" is null.");
}
if (start... | java | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static Identifier fromBytes(byte[] bytes, int start, int end, boolean littleEndian) {
if (bytes == null) {
throw new NullPointerException("Identifiers cannot be constructed from null pointers but \"bytes\" is null.");
}
if (start... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"GINGERBREAD",
")",
"public",
"static",
"Identifier",
"fromBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"start",
",",
"int",
"end",
",",
"boolean",
"littleEndian",
")",
"{",
"if",
"(",
"by... | Creates an Identifier from the specified byte array.
@param bytes array to copy from
@param start the start index, inclusive
@param end the end index, exclusive
@param littleEndian whether the bytes are ordered in little endian
@return a new Identifier
@throws java.lang.NullPointerException <code>bytes</code> must not ... | [
"Creates",
"an",
"Identifier",
"from",
"the",
"specified",
"byte",
"array",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L171-L191 |
25,110 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.toByteArrayOfSpecifiedEndianness | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public byte[] toByteArrayOfSpecifiedEndianness(boolean bigEndian) {
byte[] copy = Arrays.copyOf(mValue, mValue.length);
if (!bigEndian) {
reverseArray(copy);
}
return copy;
} | java | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public byte[] toByteArrayOfSpecifiedEndianness(boolean bigEndian) {
byte[] copy = Arrays.copyOf(mValue, mValue.length);
if (!bigEndian) {
reverseArray(copy);
}
return copy;
} | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"GINGERBREAD",
")",
"public",
"byte",
"[",
"]",
"toByteArrayOfSpecifiedEndianness",
"(",
"boolean",
"bigEndian",
")",
"{",
"byte",
"[",
"]",
"copy",
"=",
"Arrays",
".",
"copyOf",
"(",
"mValue",
",",
... | Converts identifier to a byte array
@param bigEndian true if bytes are MSB first
@return a new byte array with a copy of the value | [
"Converts",
"identifier",
"to",
"a",
"byte",
"array"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L272-L281 |
25,111 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.toUuid | public UUID toUuid() {
if (mValue.length != 16) {
throw new UnsupportedOperationException("Only Identifiers backed by a byte array with length of exactly 16 can be UUIDs.");
}
LongBuffer buf = ByteBuffer.wrap(mValue).asLongBuffer();
return new UUID(buf.get(), buf.get());
... | java | public UUID toUuid() {
if (mValue.length != 16) {
throw new UnsupportedOperationException("Only Identifiers backed by a byte array with length of exactly 16 can be UUIDs.");
}
LongBuffer buf = ByteBuffer.wrap(mValue).asLongBuffer();
return new UUID(buf.get(), buf.get());
... | [
"public",
"UUID",
"toUuid",
"(",
")",
"{",
"if",
"(",
"mValue",
".",
"length",
"!=",
"16",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"(",
"\"Only Identifiers backed by a byte array with length of exactly 16 can be UUIDs.\"",
")",
";",
"}",
"LongBuffer",... | Gives you the Identifier as a UUID if possible.
@throws UnsupportedOperationException if the byte array backing this Identifier is not exactly
16 bytes long. | [
"Gives",
"you",
"the",
"Identifier",
"as",
"a",
"UUID",
"if",
"possible",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L358-L364 |
25,112 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.compareTo | @Override
public int compareTo(Identifier that) {
if (mValue.length != that.mValue.length) {
return mValue.length < that.mValue.length ? -1 : 1;
}
for (int i = 0; i < mValue.length; i++) {
if (mValue[i] != that.mValue[i]) {
return mValue[i] < that.mVal... | java | @Override
public int compareTo(Identifier that) {
if (mValue.length != that.mValue.length) {
return mValue.length < that.mValue.length ? -1 : 1;
}
for (int i = 0; i < mValue.length; i++) {
if (mValue[i] != that.mValue[i]) {
return mValue[i] < that.mVal... | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"Identifier",
"that",
")",
"{",
"if",
"(",
"mValue",
".",
"length",
"!=",
"that",
".",
"mValue",
".",
"length",
")",
"{",
"return",
"mValue",
".",
"length",
"<",
"that",
".",
"mValue",
".",
"length",
... | Compares two identifiers.
When the Identifiers don't have the same length, the Identifier having the shortest
array is considered smaller than the other.
@param that the other identifier
@return 0 if both identifiers are equal. Otherwise returns -1 or 1 depending
on which is bigger than the other.
@see ... | [
"Compares",
"two",
"identifiers",
".",
"When",
"the",
"Identifiers",
"don",
"t",
"have",
"the",
"same",
"length",
"the",
"Identifier",
"having",
"the",
"shortest",
"array",
"is",
"considered",
"smaller",
"than",
"the",
"other",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L386-L397 |
25,113 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/distance/AndroidModel.java | AndroidModel.matchScore | public int matchScore(AndroidModel otherModel) {
int score = 0;
if (this.mManufacturer.equalsIgnoreCase(otherModel.mManufacturer)) {
score = 1;
}
if (score ==1 && this.mModel.equals(otherModel.mModel)) {
score = 2;
}
if (score == 2 && this.mBuildNu... | java | public int matchScore(AndroidModel otherModel) {
int score = 0;
if (this.mManufacturer.equalsIgnoreCase(otherModel.mManufacturer)) {
score = 1;
}
if (score ==1 && this.mModel.equals(otherModel.mModel)) {
score = 2;
}
if (score == 2 && this.mBuildNu... | [
"public",
"int",
"matchScore",
"(",
"AndroidModel",
"otherModel",
")",
"{",
"int",
"score",
"=",
"0",
";",
"if",
"(",
"this",
".",
"mManufacturer",
".",
"equalsIgnoreCase",
"(",
"otherModel",
".",
"mManufacturer",
")",
")",
"{",
"score",
"=",
"1",
";",
"... | Calculates a qualitative match score between two different Android device models for the
purposes of how likely they are to have similar Bluetooth signal level responses
@param otherModel
@return match quality, higher numbers are a better match | [
"Calculates",
"a",
"qualitative",
"match",
"score",
"between",
"two",
"different",
"Android",
"device",
"models",
"for",
"the",
"purposes",
"of",
"how",
"likely",
"they",
"are",
"to",
"have",
"similar",
"Bluetooth",
"signal",
"level",
"responses"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/distance/AndroidModel.java#L76-L92 |
25,114 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Beacon.java | Beacon.getIdentifiers | public List<Identifier> getIdentifiers() {
if (mIdentifiers.getClass().isInstance(UNMODIFIABLE_LIST_OF_IDENTIFIER)) {
return mIdentifiers;
}
else {
return Collections.unmodifiableList(mIdentifiers);
}
} | java | public List<Identifier> getIdentifiers() {
if (mIdentifiers.getClass().isInstance(UNMODIFIABLE_LIST_OF_IDENTIFIER)) {
return mIdentifiers;
}
else {
return Collections.unmodifiableList(mIdentifiers);
}
} | [
"public",
"List",
"<",
"Identifier",
">",
"getIdentifiers",
"(",
")",
"{",
"if",
"(",
"mIdentifiers",
".",
"getClass",
"(",
")",
".",
"isInstance",
"(",
"UNMODIFIABLE_LIST_OF_IDENTIFIER",
")",
")",
"{",
"return",
"mIdentifiers",
";",
"}",
"else",
"{",
"retur... | Returns the list of identifiers transmitted with the advertisement
@return identifier | [
"Returns",
"the",
"list",
"of",
"identifiers",
"transmitted",
"with",
"the",
"advertisement"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Beacon.java#L453-L460 |
25,115 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Beacon.java | Beacon.getDistance | public double getDistance() {
if (mDistance == null) {
double bestRssiAvailable = mRssi;
if (mRunningAverageRssi != null) {
bestRssiAvailable = mRunningAverageRssi;
}
else {
LogManager.d(TAG, "Not using running average RSSI because ... | java | public double getDistance() {
if (mDistance == null) {
double bestRssiAvailable = mRssi;
if (mRunningAverageRssi != null) {
bestRssiAvailable = mRunningAverageRssi;
}
else {
LogManager.d(TAG, "Not using running average RSSI because ... | [
"public",
"double",
"getDistance",
"(",
")",
"{",
"if",
"(",
"mDistance",
"==",
"null",
")",
"{",
"double",
"bestRssiAvailable",
"=",
"mRssi",
";",
"if",
"(",
"mRunningAverageRssi",
"!=",
"null",
")",
"{",
"bestRssiAvailable",
"=",
"mRunningAverageRssi",
";",
... | Provides a calculated estimate of the distance to the beacon based on a running average of
the RSSI and the transmitted power calibration value included in the beacon advertisement.
This value is specific to the type of Android device receiving the transmission.
@see #mDistance
@return distance | [
"Provides",
"a",
"calculated",
"estimate",
"of",
"the",
"distance",
"to",
"the",
"beacon",
"based",
"on",
"a",
"running",
"average",
"of",
"the",
"RSSI",
"and",
"the",
"transmitted",
"power",
"calibration",
"value",
"included",
"in",
"the",
"beacon",
"advertis... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Beacon.java#L471-L483 |
25,116 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Beacon.java | Beacon.writeToParcel | @Deprecated
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mIdentifiers.size());
for (Identifier identifier: mIdentifiers) {
out.writeString(identifier == null ? null : identifier.toString());
}
out.writeDouble(getDistance());
out.writeInt(mRssi);... | java | @Deprecated
public void writeToParcel(Parcel out, int flags) {
out.writeInt(mIdentifiers.size());
for (Identifier identifier: mIdentifiers) {
out.writeString(identifier == null ? null : identifier.toString());
}
out.writeDouble(getDistance());
out.writeInt(mRssi);... | [
"@",
"Deprecated",
"public",
"void",
"writeToParcel",
"(",
"Parcel",
"out",
",",
"int",
"flags",
")",
"{",
"out",
".",
"writeInt",
"(",
"mIdentifiers",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Identifier",
"identifier",
":",
"mIdentifiers",
")",
"{"... | Required for making object Parcelable. If you override this class, you must override this
method if you add any additional fields. | [
"Required",
"for",
"making",
"object",
"Parcelable",
".",
"If",
"you",
"override",
"this",
"class",
"you",
"must",
"override",
"this",
"method",
"if",
"you",
"add",
"any",
"additional",
"fields",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Beacon.java#L612-L639 |
25,117 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Region.java | Region.matchesBeacon | public boolean matchesBeacon(Beacon beacon) {
// All identifiers must match, or the corresponding region identifier must be null.
for (int i = mIdentifiers.size(); --i >= 0; ) {
final Identifier identifier = mIdentifiers.get(i);
Identifier beaconIdentifier = null;
if ... | java | public boolean matchesBeacon(Beacon beacon) {
// All identifiers must match, or the corresponding region identifier must be null.
for (int i = mIdentifiers.size(); --i >= 0; ) {
final Identifier identifier = mIdentifiers.get(i);
Identifier beaconIdentifier = null;
if ... | [
"public",
"boolean",
"matchesBeacon",
"(",
"Beacon",
"beacon",
")",
"{",
"// All identifiers must match, or the corresponding region identifier must be null.",
"for",
"(",
"int",
"i",
"=",
"mIdentifiers",
".",
"size",
"(",
")",
";",
"--",
"i",
">=",
"0",
";",
")",
... | Checks to see if an Beacon object is included in the matching criteria of this Region
@param beacon the beacon to check to see if it is in the Region
@return true if is covered | [
"Checks",
"to",
"see",
"if",
"an",
"Beacon",
"object",
"is",
"included",
"in",
"the",
"matching",
"criteria",
"of",
"this",
"Region"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Region.java#L183-L200 |
25,118 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconParser.java | BeaconParser.fromScanData | public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) {
return fromScanData(scanData, rssi, device, new Beacon());
} | java | public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) {
return fromScanData(scanData, rssi, device, new Beacon());
} | [
"public",
"Beacon",
"fromScanData",
"(",
"byte",
"[",
"]",
"scanData",
",",
"int",
"rssi",
",",
"BluetoothDevice",
"device",
")",
"{",
"return",
"fromScanData",
"(",
"scanData",
",",
"rssi",
",",
"device",
",",
"new",
"Beacon",
"(",
")",
")",
";",
"}"
] | Construct a Beacon from a Bluetooth LE packet collected by Android's Bluetooth APIs,
including the raw Bluetooth device info
@param scanData The actual packet bytes
@param rssi The measured signal strength of the packet
@param device The Bluetooth device that was detected
@return An instance of a <code>Beacon</code> | [
"Construct",
"a",
"Beacon",
"from",
"a",
"Bluetooth",
"LE",
"packet",
"collected",
"by",
"Android",
"s",
"Bluetooth",
"APIs",
"including",
"the",
"raw",
"Bluetooth",
"device",
"info"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconParser.java#L417-L419 |
25,119 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java | BeaconTransmitter.startAdvertising | public void startAdvertising(Beacon beacon, AdvertiseCallback callback) {
mBeacon = beacon;
mAdvertisingClientCallback = callback;
startAdvertising();
} | java | public void startAdvertising(Beacon beacon, AdvertiseCallback callback) {
mBeacon = beacon;
mAdvertisingClientCallback = callback;
startAdvertising();
} | [
"public",
"void",
"startAdvertising",
"(",
"Beacon",
"beacon",
",",
"AdvertiseCallback",
"callback",
")",
"{",
"mBeacon",
"=",
"beacon",
";",
"mAdvertisingClientCallback",
"=",
"callback",
";",
"startAdvertising",
"(",
")",
";",
"}"
] | Starts advertising with fields from the passed beacon
@param beacon | [
"Starts",
"advertising",
"with",
"fields",
"from",
"the",
"passed",
"beacon"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java#L156-L160 |
25,120 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java | BeaconTransmitter.startAdvertising | public void startAdvertising() {
if (mBeacon == null) {
throw new NullPointerException("Beacon cannot be null. Set beacon before starting advertising");
}
int manufacturerCode = mBeacon.getManufacturer();
int serviceUuid = -1;
if (mBeaconParser.getServiceUuid() != nu... | java | public void startAdvertising() {
if (mBeacon == null) {
throw new NullPointerException("Beacon cannot be null. Set beacon before starting advertising");
}
int manufacturerCode = mBeacon.getManufacturer();
int serviceUuid = -1;
if (mBeaconParser.getServiceUuid() != nu... | [
"public",
"void",
"startAdvertising",
"(",
")",
"{",
"if",
"(",
"mBeacon",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"Beacon cannot be null. Set beacon before starting advertising\"",
")",
";",
"}",
"int",
"manufacturerCode",
"=",
"mBeaco... | Starts this beacon advertising | [
"Starts",
"this",
"beacon",
"advertising"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java#L165-L219 |
25,121 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java | BeaconTransmitter.stopAdvertising | public void stopAdvertising() {
if (!mStarted) {
LogManager.d(TAG, "Skipping stop advertising -- not started");
return;
}
LogManager.d(TAG, "Stopping advertising with object %s", mBluetoothLeAdvertiser);
mAdvertisingClientCallback = null;
try {
... | java | public void stopAdvertising() {
if (!mStarted) {
LogManager.d(TAG, "Skipping stop advertising -- not started");
return;
}
LogManager.d(TAG, "Stopping advertising with object %s", mBluetoothLeAdvertiser);
mAdvertisingClientCallback = null;
try {
... | [
"public",
"void",
"stopAdvertising",
"(",
")",
"{",
"if",
"(",
"!",
"mStarted",
")",
"{",
"LogManager",
".",
"d",
"(",
"TAG",
",",
"\"Skipping stop advertising -- not started\"",
")",
";",
"return",
";",
"}",
"LogManager",
".",
"d",
"(",
"TAG",
",",
"\"Sto... | Stops this beacon from advertising | [
"Stops",
"this",
"beacon",
"from",
"advertising"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java#L224-L238 |
25,122 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java | BeaconTransmitter.checkTransmissionSupported | public static int checkTransmissionSupported(Context context) {
int returnCode = SUPPORTED;
if (android.os.Build.VERSION.SDK_INT < 21) {
returnCode = NOT_SUPPORTED_MIN_SDK;
}
else if (!context.getApplicationContext().getPackageManager().hasSystemFeature(PackageManager.FEATUR... | java | public static int checkTransmissionSupported(Context context) {
int returnCode = SUPPORTED;
if (android.os.Build.VERSION.SDK_INT < 21) {
returnCode = NOT_SUPPORTED_MIN_SDK;
}
else if (!context.getApplicationContext().getPackageManager().hasSystemFeature(PackageManager.FEATUR... | [
"public",
"static",
"int",
"checkTransmissionSupported",
"(",
"Context",
"context",
")",
"{",
"int",
"returnCode",
"=",
"SUPPORTED",
";",
"if",
"(",
"android",
".",
"os",
".",
"Build",
".",
"VERSION",
".",
"SDK_INT",
"<",
"21",
")",
"{",
"returnCode",
"=",... | Checks to see if this device supports beacon advertising
@return SUPPORTED if yes, otherwise:
NOT_SUPPORTED_MIN_SDK
NOT_SUPPORTED_BLE
NOT_SUPPORTED_MULTIPLE_ADVERTISEMENTS
NOT_SUPPORTED_CANNOT_GET_ADVERTISER | [
"Checks",
"to",
"see",
"if",
"this",
"device",
"supports",
"beacon",
"advertising"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconTransmitter.java#L248-L274 |
25,123 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/RangedBeacon.java | RangedBeacon.commitMeasurements | public void commitMeasurements() {
if (!getFilter().noMeasurementsAvailable()) {
double runningAverage = getFilter().calculateRssi();
mBeacon.setRunningAverageRssi(runningAverage);
mBeacon.setRssiMeasurementCount(getFilter().getMeasurementCount());
LogManager... | java | public void commitMeasurements() {
if (!getFilter().noMeasurementsAvailable()) {
double runningAverage = getFilter().calculateRssi();
mBeacon.setRunningAverageRssi(runningAverage);
mBeacon.setRssiMeasurementCount(getFilter().getMeasurementCount());
LogManager... | [
"public",
"void",
"commitMeasurements",
"(",
")",
"{",
"if",
"(",
"!",
"getFilter",
"(",
")",
".",
"noMeasurementsAvailable",
"(",
")",
")",
"{",
"double",
"runningAverage",
"=",
"getFilter",
"(",
")",
".",
"calculateRssi",
"(",
")",
";",
"mBeacon",
".",
... | Done at the end of each cycle before data are sent to the client | [
"Done",
"at",
"the",
"end",
"of",
"each",
"cycle",
"before",
"data",
"are",
"sent",
"to",
"the",
"client"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/RangedBeacon.java#L49-L61 |
25,124 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/scanner/CycledLeScanner.java | CycledLeScanner.setScanPeriods | @MainThread
public void setScanPeriods(long scanPeriod, long betweenScanPeriod, boolean backgroundFlag) {
LogManager.d(TAG, "Set scan periods called with %s, %s Background mode must have changed.",
scanPeriod, betweenScanPeriod);
if (mBackgroundFlag != backgroundFlag) {
m... | java | @MainThread
public void setScanPeriods(long scanPeriod, long betweenScanPeriod, boolean backgroundFlag) {
LogManager.d(TAG, "Set scan periods called with %s, %s Background mode must have changed.",
scanPeriod, betweenScanPeriod);
if (mBackgroundFlag != backgroundFlag) {
m... | [
"@",
"MainThread",
"public",
"void",
"setScanPeriods",
"(",
"long",
"scanPeriod",
",",
"long",
"betweenScanPeriod",
",",
"boolean",
"backgroundFlag",
")",
"{",
"LogManager",
".",
"d",
"(",
"TAG",
",",
"\"Set scan periods called with %s, %s Background mode must have change... | Tells the cycler the scan rate and whether it is in operating in background mode.
Background mode flag is used only with the Android 5.0 scanning implementations to switch
between LOW_POWER_MODE vs. LOW_LATENCY_MODE
@param backgroundFlag | [
"Tells",
"the",
"cycler",
"the",
"scan",
"rate",
"and",
"whether",
"it",
"is",
"in",
"operating",
"in",
"background",
"mode",
".",
"Background",
"mode",
"flag",
"is",
"used",
"only",
"with",
"the",
"Android",
"5",
".",
"0",
"scanning",
"implementations",
"... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/scanner/CycledLeScanner.java#L173-L212 |
25,125 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/scanner/CycledLeScanner.java | CycledLeScanner.setWakeUpAlarm | protected void setWakeUpAlarm() {
// wake up time will be the maximum of 5 minutes, the scan period, the between scan period
long milliseconds = 1000l * 60 * 5; /* five minutes */
if (milliseconds < mBetweenScanPeriod) {
milliseconds = mBetweenScanPeriod;
}
if (millis... | java | protected void setWakeUpAlarm() {
// wake up time will be the maximum of 5 minutes, the scan period, the between scan period
long milliseconds = 1000l * 60 * 5; /* five minutes */
if (milliseconds < mBetweenScanPeriod) {
milliseconds = mBetweenScanPeriod;
}
if (millis... | [
"protected",
"void",
"setWakeUpAlarm",
"(",
")",
"{",
"// wake up time will be the maximum of 5 minutes, the scan period, the between scan period",
"long",
"milliseconds",
"=",
"1000l",
"*",
"60",
"*",
"5",
";",
"/* five minutes */",
"if",
"(",
"milliseconds",
"<",
"mBetwee... | off the scan cycle again | [
"off",
"the",
"scan",
"cycle",
"again"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/scanner/CycledLeScanner.java#L478-L491 |
25,126 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/ScanHelper.java | ScanHelper.getScanCallbackIntent | PendingIntent getScanCallbackIntent() {
Intent intent = new Intent(mContext, StartupBroadcastReceiver.class);
intent.putExtra("o-scan", true);
return PendingIntent.getBroadcast(mContext,0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
} | java | PendingIntent getScanCallbackIntent() {
Intent intent = new Intent(mContext, StartupBroadcastReceiver.class);
intent.putExtra("o-scan", true);
return PendingIntent.getBroadcast(mContext,0, intent, PendingIntent.FLAG_UPDATE_CURRENT);
} | [
"PendingIntent",
"getScanCallbackIntent",
"(",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"mContext",
",",
"StartupBroadcastReceiver",
".",
"class",
")",
";",
"intent",
".",
"putExtra",
"(",
"\"o-scan\"",
",",
"true",
")",
";",
"return",
"Pending... | Low power scan results in the background will be delivered via Intent | [
"Low",
"power",
"scan",
"results",
"in",
"the",
"background",
"will",
"be",
"delivered",
"via",
"Intent"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/ScanHelper.java#L250-L254 |
25,127 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/startup/RegionBootstrap.java | RegionBootstrap.disable | public void disable() {
if (disabled) {
return;
}
disabled = true;
try {
for (Region region : regions) {
beaconManager.stopMonitoringBeaconsInRegion(region);
}
} catch (RemoteException e) {
LogManager.e(e, TAG, "Can'... | java | public void disable() {
if (disabled) {
return;
}
disabled = true;
try {
for (Region region : regions) {
beaconManager.stopMonitoringBeaconsInRegion(region);
}
} catch (RemoteException e) {
LogManager.e(e, TAG, "Can'... | [
"public",
"void",
"disable",
"(",
")",
"{",
"if",
"(",
"disabled",
")",
"{",
"return",
";",
"}",
"disabled",
"=",
"true",
";",
"try",
"{",
"for",
"(",
"Region",
"region",
":",
"regions",
")",
"{",
"beaconManager",
".",
"stopMonitoringBeaconsInRegion",
"(... | Used to disable additional bootstrap callbacks after the first is received. Unless this is called,
your application will be get additional calls as the supplied regions are entered or exited. | [
"Used",
"to",
"disable",
"additional",
"bootstrap",
"callbacks",
"after",
"the",
"first",
"is",
"received",
".",
"Unless",
"this",
"is",
"called",
"your",
"application",
"will",
"be",
"get",
"additional",
"calls",
"as",
"the",
"supplied",
"regions",
"are",
"en... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/startup/RegionBootstrap.java#L133-L146 |
25,128 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/startup/RegionBootstrap.java | RegionBootstrap.addRegion | public void addRegion(Region region) {
if (!regions.contains(region)) {
if (serviceConnected) {
try {
beaconManager.startMonitoringBeaconsInRegion(region);
} catch (RemoteException e) {
LogManager.e(e, TAG, "Can't add bootstrap ... | java | public void addRegion(Region region) {
if (!regions.contains(region)) {
if (serviceConnected) {
try {
beaconManager.startMonitoringBeaconsInRegion(region);
} catch (RemoteException e) {
LogManager.e(e, TAG, "Can't add bootstrap ... | [
"public",
"void",
"addRegion",
"(",
"Region",
"region",
")",
"{",
"if",
"(",
"!",
"regions",
".",
"contains",
"(",
"region",
")",
")",
"{",
"if",
"(",
"serviceConnected",
")",
"{",
"try",
"{",
"beaconManager",
".",
"startMonitoringBeaconsInRegion",
"(",
"r... | Add a new region
@param region | [
"Add",
"a",
"new",
"region"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/startup/RegionBootstrap.java#L153-L166 |
25,129 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/startup/RegionBootstrap.java | RegionBootstrap.removeRegion | public void removeRegion(Region region) {
if (regions.contains(region)) {
if (serviceConnected) {
try {
beaconManager.stopMonitoringBeaconsInRegion(region);
} catch (RemoteException e) {
LogManager.e(e, TAG, "Can't stop bootstra... | java | public void removeRegion(Region region) {
if (regions.contains(region)) {
if (serviceConnected) {
try {
beaconManager.stopMonitoringBeaconsInRegion(region);
} catch (RemoteException e) {
LogManager.e(e, TAG, "Can't stop bootstra... | [
"public",
"void",
"removeRegion",
"(",
"Region",
"region",
")",
"{",
"if",
"(",
"regions",
".",
"contains",
"(",
"region",
")",
")",
"{",
"if",
"(",
"serviceConnected",
")",
"{",
"try",
"{",
"beaconManager",
".",
"stopMonitoringBeaconsInRegion",
"(",
"region... | Remove a given region
@param region | [
"Remove",
"a",
"given",
"region"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/startup/RegionBootstrap.java#L173-L186 |
25,130 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/RangeState.java | RangeState.finalizeBeacons | public synchronized Collection<Beacon> finalizeBeacons() {
Map<Beacon,RangedBeacon> newRangedBeacons = new HashMap<Beacon,RangedBeacon>();
ArrayList<Beacon> finalizedBeacons = new ArrayList<Beacon>();
synchronized (mRangedBeacons) {
for (Beacon beacon : mRangedBeacons.keySet()) {
... | java | public synchronized Collection<Beacon> finalizeBeacons() {
Map<Beacon,RangedBeacon> newRangedBeacons = new HashMap<Beacon,RangedBeacon>();
ArrayList<Beacon> finalizedBeacons = new ArrayList<Beacon>();
synchronized (mRangedBeacons) {
for (Beacon beacon : mRangedBeacons.keySet()) {
... | [
"public",
"synchronized",
"Collection",
"<",
"Beacon",
">",
"finalizeBeacons",
"(",
")",
"{",
"Map",
"<",
"Beacon",
",",
"RangedBeacon",
">",
"newRangedBeacons",
"=",
"new",
"HashMap",
"<",
"Beacon",
",",
"RangedBeacon",
">",
"(",
")",
";",
"ArrayList",
"<",... | be there for the next cycle | [
"be",
"there",
"for",
"the",
"next",
"cycle"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/RangeState.java#L67-L99 |
25,131 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/ScanJob.java | ScanJob.initialzeScanHelper | private boolean initialzeScanHelper() {
mScanHelper = new ScanHelper(this);
mScanState = ScanState.restore(ScanJob.this);
mScanState.setLastScanStartTimeMillis(System.currentTimeMillis());
mScanHelper.setMonitoringStatus(mScanState.getMonitoringStatus());
mScanHelper.setRangedReg... | java | private boolean initialzeScanHelper() {
mScanHelper = new ScanHelper(this);
mScanState = ScanState.restore(ScanJob.this);
mScanState.setLastScanStartTimeMillis(System.currentTimeMillis());
mScanHelper.setMonitoringStatus(mScanState.getMonitoringStatus());
mScanHelper.setRangedReg... | [
"private",
"boolean",
"initialzeScanHelper",
"(",
")",
"{",
"mScanHelper",
"=",
"new",
"ScanHelper",
"(",
"this",
")",
";",
"mScanState",
"=",
"ScanState",
".",
"restore",
"(",
"ScanJob",
".",
"this",
")",
";",
"mScanState",
".",
"setLastScanStartTimeMillis",
... | Returns false if cycle thread cannot be allocated | [
"Returns",
"false",
"if",
"cycle",
"thread",
"cannot",
"be",
"allocated"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/ScanJob.java#L182-L200 |
25,132 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.setDebug | public static void setDebug(boolean debug) {
if (debug) {
LogManager.setLogger(Loggers.verboseLogger());
LogManager.setVerboseLoggingEnabled(true);
} else {
LogManager.setLogger(Loggers.empty());
LogManager.setVerboseLoggingEnabled(false);
}
} | java | public static void setDebug(boolean debug) {
if (debug) {
LogManager.setLogger(Loggers.verboseLogger());
LogManager.setVerboseLoggingEnabled(true);
} else {
LogManager.setLogger(Loggers.empty());
LogManager.setVerboseLoggingEnabled(false);
}
} | [
"public",
"static",
"void",
"setDebug",
"(",
"boolean",
"debug",
")",
"{",
"if",
"(",
"debug",
")",
"{",
"LogManager",
".",
"setLogger",
"(",
"Loggers",
".",
"verboseLogger",
"(",
")",
")",
";",
"LogManager",
".",
"setVerboseLoggingEnabled",
"(",
"true",
"... | Set to true if you want to show library debugging.
@param debug True turn on all logs for this library to be printed out to logcat. False turns
off detailed logging..
This is a convenience method that calls setLogger to a verbose logger and enables verbose
logging. For more fine grained control, use:
{@link org.altbe... | [
"Set",
"to",
"true",
"if",
"you",
"want",
"to",
"show",
"library",
"debugging",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L187-L195 |
25,133 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.setRegionExitPeriod | public static void setRegionExitPeriod(long regionExitPeriod){
sExitRegionPeriod = regionExitPeriod;
BeaconManager instance = sInstance;
if (instance != null) {
instance.applySettings();
}
} | java | public static void setRegionExitPeriod(long regionExitPeriod){
sExitRegionPeriod = regionExitPeriod;
BeaconManager instance = sInstance;
if (instance != null) {
instance.applySettings();
}
} | [
"public",
"static",
"void",
"setRegionExitPeriod",
"(",
"long",
"regionExitPeriod",
")",
"{",
"sExitRegionPeriod",
"=",
"regionExitPeriod",
";",
"BeaconManager",
"instance",
"=",
"sInstance",
";",
"if",
"(",
"instance",
"!=",
"null",
")",
"{",
"instance",
".",
"... | Set region exit period in milliseconds
@param regionExitPeriod | [
"Set",
"region",
"exit",
"period",
"in",
"milliseconds"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L280-L286 |
25,134 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.checkAvailability | @TargetApi(18)
public boolean checkAvailability() throws BleNotAvailableException {
if (!isBleAvailableOrSimulated()) {
throw new BleNotAvailableException("Bluetooth LE not supported by this device");
}
return ((BluetoothManager) mContext.getSystemService(Context.BLUETOOTH_SERVIC... | java | @TargetApi(18)
public boolean checkAvailability() throws BleNotAvailableException {
if (!isBleAvailableOrSimulated()) {
throw new BleNotAvailableException("Bluetooth LE not supported by this device");
}
return ((BluetoothManager) mContext.getSystemService(Context.BLUETOOTH_SERVIC... | [
"@",
"TargetApi",
"(",
"18",
")",
"public",
"boolean",
"checkAvailability",
"(",
")",
"throws",
"BleNotAvailableException",
"{",
"if",
"(",
"!",
"isBleAvailableOrSimulated",
"(",
")",
")",
"{",
"throw",
"new",
"BleNotAvailableException",
"(",
"\"Bluetooth LE not sup... | Check if Bluetooth LE is supported by this Android device, and if so, make sure it is enabled.
@return false if it is supported and not enabled
@throws BleNotAvailableException if Bluetooth LE is not supported. (Note: The Android emulator will do this) | [
"Check",
"if",
"Bluetooth",
"LE",
"is",
"supported",
"by",
"this",
"Android",
"device",
"and",
"if",
"so",
"make",
"sure",
"it",
"is",
"enabled",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L395-L401 |
25,135 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.setBackgroundMode | public void setBackgroundMode(boolean backgroundMode) {
if (!isBleAvailableOrSimulated()) {
LogManager.w(TAG, "Method invocation will be ignored.");
return;
}
mBackgroundModeUninitialized = false;
if (backgroundMode != mBackgroundMode) {
mBackgroundMod... | java | public void setBackgroundMode(boolean backgroundMode) {
if (!isBleAvailableOrSimulated()) {
LogManager.w(TAG, "Method invocation will be ignored.");
return;
}
mBackgroundModeUninitialized = false;
if (backgroundMode != mBackgroundMode) {
mBackgroundMod... | [
"public",
"void",
"setBackgroundMode",
"(",
"boolean",
"backgroundMode",
")",
"{",
"if",
"(",
"!",
"isBleAvailableOrSimulated",
"(",
")",
")",
"{",
"LogManager",
".",
"w",
"(",
"TAG",
",",
"\"Method invocation will be ignored.\"",
")",
";",
"return",
";",
"}",
... | This method notifies the beacon service that the application is either moving to background
mode or foreground mode. When in background mode, BluetoothLE scans to look for beacons are
executed less frequently in order to save battery life. The specific scan rates for
background and foreground operation are set by the ... | [
"This",
"method",
"notifies",
"the",
"beacon",
"service",
"that",
"the",
"application",
"is",
"either",
"moving",
"to",
"background",
"mode",
"or",
"foreground",
"mode",
".",
"When",
"in",
"background",
"mode",
"BluetoothLE",
"scans",
"to",
"look",
"for",
"bea... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L547-L561 |
25,136 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.setEnableScheduledScanJobs | public void setEnableScheduledScanJobs(boolean enabled) {
if (isAnyConsumerBound()) {
LogManager.e(TAG, "ScanJob may not be configured because a consumer is" +
" already bound.");
throw new IllegalStateException("Method must be called before calling bind()");
... | java | public void setEnableScheduledScanJobs(boolean enabled) {
if (isAnyConsumerBound()) {
LogManager.e(TAG, "ScanJob may not be configured because a consumer is" +
" already bound.");
throw new IllegalStateException("Method must be called before calling bind()");
... | [
"public",
"void",
"setEnableScheduledScanJobs",
"(",
"boolean",
"enabled",
")",
"{",
"if",
"(",
"isAnyConsumerBound",
"(",
")",
")",
"{",
"LogManager",
".",
"e",
"(",
"TAG",
",",
"\"ScanJob may not be configured because a consumer is\"",
"+",
"\" already bound.\"",
")... | Configures using a `ScanJob` run with the `JobScheduler` to perform scans rather than using a
long-running `BeaconService` to do so.
Calling with true on devices older than Android L (5.0) will not apply the change
as the JobScheduler is not available.
This value defaults to true on Android O+ and false on devices wi... | [
"Configures",
"using",
"a",
"ScanJob",
"run",
"with",
"the",
"JobScheduler",
"to",
"perform",
"scans",
"rather",
"than",
"using",
"a",
"long",
"-",
"running",
"BeaconService",
"to",
"do",
"so",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L584-L603 |
25,137 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.setRegionStatePersistenceEnabled | public void setRegionStatePersistenceEnabled(boolean enabled) {
mRegionStatePersistenceEnabled = enabled;
if (!isScannerInDifferentProcess()) {
if (enabled) {
MonitoringStatus.getInstanceForApplication(mContext).startStatusPreservation();
} else {
... | java | public void setRegionStatePersistenceEnabled(boolean enabled) {
mRegionStatePersistenceEnabled = enabled;
if (!isScannerInDifferentProcess()) {
if (enabled) {
MonitoringStatus.getInstanceForApplication(mContext).startStatusPreservation();
} else {
... | [
"public",
"void",
"setRegionStatePersistenceEnabled",
"(",
"boolean",
"enabled",
")",
"{",
"mRegionStatePersistenceEnabled",
"=",
"enabled",
";",
"if",
"(",
"!",
"isScannerInDifferentProcess",
"(",
")",
")",
"{",
"if",
"(",
"enabled",
")",
"{",
"MonitoringStatus",
... | Turns off saving the state of monitored regions to persistent storage so it is retained over
app restarts. Defaults to enabled. When enabled, there will not be an "extra" region entry
event when the app starts up and a beacon for a monitored region was previously visible
within the past 15 minutes. Note that there i... | [
"Turns",
"off",
"saving",
"the",
"state",
"of",
"monitored",
"regions",
"to",
"persistent",
"storage",
"so",
"it",
"is",
"retained",
"over",
"app",
"restarts",
".",
"Defaults",
"to",
"enabled",
".",
"When",
"enabled",
"there",
"will",
"not",
"be",
"an",
"e... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L787-L797 |
25,138 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.applySettings | public void applySettings() {
if (determineIfCalledFromSeparateScannerProcess()) {
return;
}
if (!isAnyConsumerBound()) {
LogManager.d(TAG, "Not synchronizing settings to service, as it has not started up yet");
} else if (isScannerInDifferentProcess()) {
... | java | public void applySettings() {
if (determineIfCalledFromSeparateScannerProcess()) {
return;
}
if (!isAnyConsumerBound()) {
LogManager.d(TAG, "Not synchronizing settings to service, as it has not started up yet");
} else if (isScannerInDifferentProcess()) {
... | [
"public",
"void",
"applySettings",
"(",
")",
"{",
"if",
"(",
"determineIfCalledFromSeparateScannerProcess",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"isAnyConsumerBound",
"(",
")",
")",
"{",
"LogManager",
".",
"d",
"(",
"TAG",
",",
"\"Not sy... | Call this method if you are running the scanner service in a different process in order to
synchronize any configuration settings, including BeaconParsers to the scanner
@see #isScannerInDifferentProcess() | [
"Call",
"this",
"method",
"if",
"you",
"are",
"running",
"the",
"scanner",
"service",
"in",
"a",
"different",
"process",
"in",
"order",
"to",
"synchronize",
"any",
"configuration",
"settings",
"including",
"BeaconParsers",
"to",
"the",
"scanner"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L891-L903 |
25,139 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/BeaconManager.java | BeaconManager.enableForegroundServiceScanning | public void enableForegroundServiceScanning(Notification notification, int notificationId)
throws IllegalStateException {
if (isAnyConsumerBound()) {
throw new IllegalStateException("May not be called after consumers are already bound.");
}
if (notification == null) {
... | java | public void enableForegroundServiceScanning(Notification notification, int notificationId)
throws IllegalStateException {
if (isAnyConsumerBound()) {
throw new IllegalStateException("May not be called after consumers are already bound.");
}
if (notification == null) {
... | [
"public",
"void",
"enableForegroundServiceScanning",
"(",
"Notification",
"notification",
",",
"int",
"notificationId",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"isAnyConsumerBound",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"M... | Configures the library to use a foreground service for bacon scanning. This allows nearly
constant scanning on most Android versions to get around background limits, and displays an
icon to the user to indicate that the app is doing something in the background, even on
Android 8+. This will disable the user of the Jo... | [
"Configures",
"the",
"library",
"to",
"use",
"a",
"foreground",
"service",
"for",
"bacon",
"scanning",
".",
"This",
"allows",
"nearly",
"constant",
"scanning",
"on",
"most",
"Android",
"versions",
"to",
"get",
"around",
"background",
"limits",
"and",
"displays",... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/BeaconManager.java#L1393-L1404 |
25,140 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/distance/CurveFittedDistanceCalculator.java | CurveFittedDistanceCalculator.calculateDistance | @Override
public double calculateDistance(int txPower, double rssi) {
if (rssi == 0) {
return -1.0; // if we cannot determine accuracy, return -1.
}
LogManager.d(TAG, "calculating distance based on mRssi of %s and txPower of %s", rssi, txPower);
double ratio = rssi*1.0... | java | @Override
public double calculateDistance(int txPower, double rssi) {
if (rssi == 0) {
return -1.0; // if we cannot determine accuracy, return -1.
}
LogManager.d(TAG, "calculating distance based on mRssi of %s and txPower of %s", rssi, txPower);
double ratio = rssi*1.0... | [
"@",
"Override",
"public",
"double",
"calculateDistance",
"(",
"int",
"txPower",
",",
"double",
"rssi",
")",
"{",
"if",
"(",
"rssi",
"==",
"0",
")",
"{",
"return",
"-",
"1.0",
";",
"// if we cannot determine accuracy, return -1.",
"}",
"LogManager",
".",
"d",
... | Calculated the estimated distance in meters to the beacon based on a reference rssi at 1m
and the known actual rssi at the current location
@param txPower
@param rssi
@return estimated distance | [
"Calculated",
"the",
"estimated",
"distance",
"in",
"meters",
"to",
"the",
"beacon",
"based",
"on",
"a",
"reference",
"rssi",
"at",
"1m",
"and",
"the",
"known",
"actual",
"rssi",
"at",
"the",
"current",
"location"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/distance/CurveFittedDistanceCalculator.java#L45-L64 |
25,141 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/bluetooth/BluetoothCrashResolver.java | BluetoothCrashResolver.notifyScannedDevice | @TargetApi(18)
public void notifyScannedDevice(BluetoothDevice device, BluetoothAdapter.LeScanCallback scanner) {
int oldSize, newSize;
oldSize = distinctBluetoothAddresses.size();
synchronized(distinctBluetoothAddresses) {
distinctBluetoothAddresses.add(device.getAddress());
... | java | @TargetApi(18)
public void notifyScannedDevice(BluetoothDevice device, BluetoothAdapter.LeScanCallback scanner) {
int oldSize, newSize;
oldSize = distinctBluetoothAddresses.size();
synchronized(distinctBluetoothAddresses) {
distinctBluetoothAddresses.add(device.getAddress());
... | [
"@",
"TargetApi",
"(",
"18",
")",
"public",
"void",
"notifyScannedDevice",
"(",
"BluetoothDevice",
"device",
",",
"BluetoothAdapter",
".",
"LeScanCallback",
"scanner",
")",
"{",
"int",
"oldSize",
",",
"newSize",
";",
"oldSize",
"=",
"distinctBluetoothAddresses",
"... | Call this method from your BluetoothAdapter.LeScanCallback method.
Doing so is optional, but if you do, this class will be able to count the number of
distinct Bluetooth devices scanned, and prevent crashes before they happen.
This works very well if the app containing this class is the only one running bluetooth
LE s... | [
"Call",
"this",
"method",
"from",
"your",
"BluetoothAdapter",
".",
"LeScanCallback",
"method",
".",
"Doing",
"so",
"is",
"optional",
"but",
"if",
"you",
"do",
"this",
"class",
"will",
"be",
"able",
"to",
"count",
"the",
"number",
"of",
"distinct",
"Bluetooth... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/bluetooth/BluetoothCrashResolver.java#L175-L200 |
25,142 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/AltBeaconParser.java | AltBeaconParser.fromScanData | @Override
public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) {
return fromScanData(scanData, rssi, device, new AltBeacon());
} | java | @Override
public Beacon fromScanData(byte[] scanData, int rssi, BluetoothDevice device) {
return fromScanData(scanData, rssi, device, new AltBeacon());
} | [
"@",
"Override",
"public",
"Beacon",
"fromScanData",
"(",
"byte",
"[",
"]",
"scanData",
",",
"int",
"rssi",
",",
"BluetoothDevice",
"device",
")",
"{",
"return",
"fromScanData",
"(",
"scanData",
",",
"rssi",
",",
"device",
",",
"new",
"AltBeacon",
"(",
")"... | Construct an AltBeacon from a Bluetooth LE packet collected by Android's Bluetooth APIs,
including the raw Bluetooth device info
@param scanData The actual packet bytes
@param rssi The measured signal strength of the packet
@param device The Bluetooth device that was detected
@return An instance of an <code>Beacon</co... | [
"Construct",
"an",
"AltBeacon",
"from",
"a",
"Bluetooth",
"LE",
"packet",
"collected",
"by",
"Android",
"s",
"Bluetooth",
"APIs",
"including",
"the",
"raw",
"Bluetooth",
"device",
"info"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/AltBeaconParser.java#L65-L68 |
25,143 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/utils/EddystoneTelemetryAccessor.java | EddystoneTelemetryAccessor.getTelemetryBytes | public byte[] getTelemetryBytes(Beacon beacon) {
if (beacon.getExtraDataFields().size() >= 5) {
Beacon telemetryBeacon = new Beacon.Builder()
.setDataFields(beacon.getExtraDataFields())
.build();
BeaconParser telemetryParser = new BeaconParser()
... | java | public byte[] getTelemetryBytes(Beacon beacon) {
if (beacon.getExtraDataFields().size() >= 5) {
Beacon telemetryBeacon = new Beacon.Builder()
.setDataFields(beacon.getExtraDataFields())
.build();
BeaconParser telemetryParser = new BeaconParser()
... | [
"public",
"byte",
"[",
"]",
"getTelemetryBytes",
"(",
"Beacon",
"beacon",
")",
"{",
"if",
"(",
"beacon",
".",
"getExtraDataFields",
"(",
")",
".",
"size",
"(",
")",
">=",
"5",
")",
"{",
"Beacon",
"telemetryBeacon",
"=",
"new",
"Beacon",
".",
"Builder",
... | Extracts the raw Eddystone telemetry bytes from the extra data fields of an associated beacon.
This is useful for passing the telemetry to Google's backend services.
@param beacon
@return the bytes of the telemetry frame | [
"Extracts",
"the",
"raw",
"Eddystone",
"telemetry",
"bytes",
"from",
"the",
"extra",
"data",
"fields",
"of",
"an",
"associated",
"beacon",
".",
"This",
"is",
"useful",
"for",
"passing",
"the",
"telemetry",
"to",
"Google",
"s",
"backend",
"services",
"."
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/utils/EddystoneTelemetryAccessor.java#L23-L37 |
25,144 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/utils/EddystoneTelemetryAccessor.java | EddystoneTelemetryAccessor.getBase64EncodedTelemetry | @TargetApi(Build.VERSION_CODES.FROYO)
public String getBase64EncodedTelemetry(Beacon beacon) {
byte[] bytes = getTelemetryBytes(beacon);
if (bytes != null) {
String base64EncodedTelemetry = Base64.encodeToString(bytes, Base64.DEFAULT);
// 12-21 00:17:18.844 20180-20180/? D/Ed... | java | @TargetApi(Build.VERSION_CODES.FROYO)
public String getBase64EncodedTelemetry(Beacon beacon) {
byte[] bytes = getTelemetryBytes(beacon);
if (bytes != null) {
String base64EncodedTelemetry = Base64.encodeToString(bytes, Base64.DEFAULT);
// 12-21 00:17:18.844 20180-20180/? D/Ed... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"FROYO",
")",
"public",
"String",
"getBase64EncodedTelemetry",
"(",
"Beacon",
"beacon",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"getTelemetryBytes",
"(",
"beacon",
")",
";",
"if",
"(",
"bytes",
"... | Extracts the raw Eddystone telemetry bytes from the extra data fields of an associated beacon
and base64 encodes them. This is useful for passing the telemetry to Google's backend
services.
@param beacon
@return base64 encoded telemetry bytes | [
"Extracts",
"the",
"raw",
"Eddystone",
"telemetry",
"bytes",
"from",
"the",
"extra",
"data",
"fields",
"of",
"an",
"associated",
"beacon",
"and",
"base64",
"encodes",
"them",
".",
"This",
"is",
"useful",
"for",
"passing",
"the",
"telemetry",
"to",
"Google",
... | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/utils/EddystoneTelemetryAccessor.java#L46-L59 |
25,145 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/service/Callback.java | Callback.call | public boolean call(Context context, String dataName, Bundle data) {
boolean useLocalBroadcast = BeaconManager.getInstanceForApplication(context).isMainProcess();
boolean success = false;
if(useLocalBroadcast) {
String action = null;
if (dataName == "rangingData") {
... | java | public boolean call(Context context, String dataName, Bundle data) {
boolean useLocalBroadcast = BeaconManager.getInstanceForApplication(context).isMainProcess();
boolean success = false;
if(useLocalBroadcast) {
String action = null;
if (dataName == "rangingData") {
... | [
"public",
"boolean",
"call",
"(",
"Context",
"context",
",",
"String",
"dataName",
",",
"Bundle",
"data",
")",
"{",
"boolean",
"useLocalBroadcast",
"=",
"BeaconManager",
".",
"getInstanceForApplication",
"(",
"context",
")",
".",
"isMainProcess",
"(",
")",
";",
... | Tries making the callback, first via messenger, then via intent
@param context
@param dataName
@param data
@return false if it callback cannot be made | [
"Tries",
"making",
"the",
"callback",
"first",
"via",
"messenger",
"then",
"via",
"intent"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/service/Callback.java#L54-L88 |
25,146 | AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/bluetooth/Pdu.java | Pdu.parse | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static Pdu parse(byte[] bytes, int startIndex) {
Pdu pdu = null;
if (bytes.length-startIndex >= 2) {
byte length = bytes[startIndex];
if (length > 0) {
byte type = bytes[startIndex + 1];
int fi... | java | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static Pdu parse(byte[] bytes, int startIndex) {
Pdu pdu = null;
if (bytes.length-startIndex >= 2) {
byte length = bytes[startIndex];
if (length > 0) {
byte type = bytes[startIndex + 1];
int fi... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"GINGERBREAD",
")",
"public",
"static",
"Pdu",
"parse",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"startIndex",
")",
"{",
"Pdu",
"pdu",
"=",
"null",
";",
"if",
"(",
"bytes",
".",
"length",
... | Parse a PDU from a byte array looking offset by startIndex
@param bytes
@param startIndex
@return | [
"Parse",
"a",
"PDU",
"from",
"a",
"byte",
"array",
"looking",
"offset",
"by",
"startIndex"
] | f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3 | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/bluetooth/Pdu.java#L28-L53 |
25,147 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.replaceAllEmojis | public static String replaceAllEmojis(String str, final String replacementString) {
EmojiParser.EmojiTransformer emojiTransformer = new EmojiParser.EmojiTransformer() {
public String transform(EmojiParser.UnicodeCandidate unicodeCandidate) {
return replacementString;
}
};
return parseFr... | java | public static String replaceAllEmojis(String str, final String replacementString) {
EmojiParser.EmojiTransformer emojiTransformer = new EmojiParser.EmojiTransformer() {
public String transform(EmojiParser.UnicodeCandidate unicodeCandidate) {
return replacementString;
}
};
return parseFr... | [
"public",
"static",
"String",
"replaceAllEmojis",
"(",
"String",
"str",
",",
"final",
"String",
"replacementString",
")",
"{",
"EmojiParser",
".",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiParser",
".",
"EmojiTransformer",
"(",
")",
"{",
"public",
... | Replace all emojis with character
@param str the string to process
@param replacementString replacement the string that will replace all the emojis
@return the string with replaced character | [
"Replace",
"all",
"emojis",
"with",
"character"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L94-L102 |
25,148 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.removeAllEmojis | public static String removeAllEmojis(String str) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
return "";
}
};
return parseFromUnicode(str, emojiTransformer);
} | java | public static String removeAllEmojis(String str) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
return "";
}
};
return parseFromUnicode(str, emojiTransformer);
} | [
"public",
"static",
"String",
"removeAllEmojis",
"(",
"String",
"str",
")",
"{",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiTransformer",
"(",
")",
"{",
"public",
"String",
"transform",
"(",
"UnicodeCandidate",
"unicodeCandidate",
")",
"{",
"return",
... | Removes all emojis from a String
@param str the string to process
@return the string without any emoji | [
"Removes",
"all",
"emojis",
"from",
"a",
"String"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L289-L297 |
25,149 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.removeEmojis | public static String removeEmojis(
String str,
final Collection<Emoji> emojisToRemove
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
if (!emojisToRemove.contains(unicodeCandidate.getEmoji())) {
return un... | java | public static String removeEmojis(
String str,
final Collection<Emoji> emojisToRemove
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
if (!emojisToRemove.contains(unicodeCandidate.getEmoji())) {
return un... | [
"public",
"static",
"String",
"removeEmojis",
"(",
"String",
"str",
",",
"final",
"Collection",
"<",
"Emoji",
">",
"emojisToRemove",
")",
"{",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiTransformer",
"(",
")",
"{",
"public",
"String",
"transform",
... | Removes a set of emojis from a String
@param str the string to process
@param emojisToRemove the emojis to remove from this string
@return the string without the emojis that were removed | [
"Removes",
"a",
"set",
"of",
"emojis",
"from",
"a",
"String"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L308-L323 |
25,150 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.removeAllEmojisExcept | public static String removeAllEmojisExcept(
String str,
final Collection<Emoji> emojisToKeep
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
if (emojisToKeep.contains(unicodeCandidate.getEmoji())) {
retur... | java | public static String removeAllEmojisExcept(
String str,
final Collection<Emoji> emojisToKeep
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
if (emojisToKeep.contains(unicodeCandidate.getEmoji())) {
retur... | [
"public",
"static",
"String",
"removeAllEmojisExcept",
"(",
"String",
"str",
",",
"final",
"Collection",
"<",
"Emoji",
">",
"emojisToKeep",
")",
"{",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiTransformer",
"(",
")",
"{",
"public",
"String",
"transf... | Removes all the emojis in a String except a provided set
@param str the string to process
@param emojisToKeep the emojis to keep in this string
@return the string without the emojis that were removed | [
"Removes",
"all",
"the",
"emojis",
"in",
"a",
"String",
"except",
"a",
"provided",
"set"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L333-L348 |
25,151 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.getNextUnicodeCandidate | protected static UnicodeCandidate getNextUnicodeCandidate(char[] chars, int start) {
for (int i = start; i < chars.length; i++) {
int emojiEnd = getEmojiEndPos(chars, i);
if (emojiEnd != -1) {
Emoji emoji = EmojiManager.getByUnicode(new String(chars, i, emojiEnd - i));
String fitzpatric... | java | protected static UnicodeCandidate getNextUnicodeCandidate(char[] chars, int start) {
for (int i = start; i < chars.length; i++) {
int emojiEnd = getEmojiEndPos(chars, i);
if (emojiEnd != -1) {
Emoji emoji = EmojiManager.getByUnicode(new String(chars, i, emojiEnd - i));
String fitzpatric... | [
"protected",
"static",
"UnicodeCandidate",
"getNextUnicodeCandidate",
"(",
"char",
"[",
"]",
"chars",
",",
"int",
"start",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"start",
";",
"i",
"<",
"chars",
".",
"length",
";",
"i",
"++",
")",
"{",
"int",
"emojiEnd... | Finds the next UnicodeCandidate after a given starting index
@param chars char array to find UnicodeCandidate in
@param start starting index for search
@return the next UnicodeCandidate or null if no UnicodeCandidate is found after start index | [
"Finds",
"the",
"next",
"UnicodeCandidate",
"after",
"a",
"given",
"starting",
"index"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L416-L434 |
25,152 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiTrie.java | EmojiTrie.isEmoji | public Matches isEmoji(char[] sequence) {
if (sequence == null) {
return Matches.POSSIBLY;
}
Node tree = root;
for (char c : sequence) {
if (!tree.hasChild(c)) {
return Matches.IMPOSSIBLE;
}
tree = tree.getChild(c);
}
return tree.isEndOfEmoji() ? Matches.EXACTLY... | java | public Matches isEmoji(char[] sequence) {
if (sequence == null) {
return Matches.POSSIBLY;
}
Node tree = root;
for (char c : sequence) {
if (!tree.hasChild(c)) {
return Matches.IMPOSSIBLE;
}
tree = tree.getChild(c);
}
return tree.isEndOfEmoji() ? Matches.EXACTLY... | [
"public",
"Matches",
"isEmoji",
"(",
"char",
"[",
"]",
"sequence",
")",
"{",
"if",
"(",
"sequence",
"==",
"null",
")",
"{",
"return",
"Matches",
".",
"POSSIBLY",
";",
"}",
"Node",
"tree",
"=",
"root",
";",
"for",
"(",
"char",
"c",
":",
"sequence",
... | Checks if sequence of chars contain an emoji.
@param sequence Sequence of char that may contain emoji in full or
partially.
@return
<li>
Matches.EXACTLY if char sequence in its entirety is an emoji
</li>
<li>
Matches.POSSIBLY if char sequence matches prefix of an emoji
</li>
<li>
Matches... | [
"Checks",
"if",
"sequence",
"of",
"chars",
"contain",
"an",
"emoji",
"."
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiTrie.java#L42-L56 |
25,153 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiTrie.java | EmojiTrie.getEmoji | public Emoji getEmoji(String unicode) {
Node tree = root;
for (char c : unicode.toCharArray()) {
if (!tree.hasChild(c)) {
return null;
}
tree = tree.getChild(c);
}
return tree.getEmoji();
} | java | public Emoji getEmoji(String unicode) {
Node tree = root;
for (char c : unicode.toCharArray()) {
if (!tree.hasChild(c)) {
return null;
}
tree = tree.getChild(c);
}
return tree.getEmoji();
} | [
"public",
"Emoji",
"getEmoji",
"(",
"String",
"unicode",
")",
"{",
"Node",
"tree",
"=",
"root",
";",
"for",
"(",
"char",
"c",
":",
"unicode",
".",
"toCharArray",
"(",
")",
")",
"{",
"if",
"(",
"!",
"tree",
".",
"hasChild",
"(",
"c",
")",
")",
"{"... | Finds Emoji instance from emoji unicode
@param unicode unicode of emoji to get
@return Emoji instance if unicode matches and emoji, null otherwise. | [
"Finds",
"Emoji",
"instance",
"from",
"emoji",
"unicode"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiTrie.java#L64-L73 |
25,154 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/Emoji.java | Emoji.stringJoin | private String stringJoin(String[] array, int count){
String joined = "";
for(int i = 0; i < count; i++)
joined += array[i];
return joined;
} | java | private String stringJoin(String[] array, int count){
String joined = "";
for(int i = 0; i < count; i++)
joined += array[i];
return joined;
} | [
"private",
"String",
"stringJoin",
"(",
"String",
"[",
"]",
"array",
",",
"int",
"count",
")",
"{",
"String",
"joined",
"=",
"\"\"",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"count",
";",
"i",
"++",
")",
"joined",
"+=",
"array",
"[",... | Method to replace String.join, since it was only introduced in java8
@param array the array to be concatenated
@return concatenated String | [
"Method",
"to",
"replace",
"String",
".",
"join",
"since",
"it",
"was",
"only",
"introduced",
"in",
"java8"
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/Emoji.java#L71-L76 |
25,155 | vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiManager.java | EmojiManager.isEmoji | public static boolean isEmoji(String string) {
if (string == null) return false;
EmojiParser.UnicodeCandidate unicodeCandidate = EmojiParser.getNextUnicodeCandidate(string.toCharArray(), 0);
return unicodeCandidate != null &&
unicodeCandidate.getEmojiStartIndex() == 0 &&
unicodeCand... | java | public static boolean isEmoji(String string) {
if (string == null) return false;
EmojiParser.UnicodeCandidate unicodeCandidate = EmojiParser.getNextUnicodeCandidate(string.toCharArray(), 0);
return unicodeCandidate != null &&
unicodeCandidate.getEmojiStartIndex() == 0 &&
unicodeCand... | [
"public",
"static",
"boolean",
"isEmoji",
"(",
"String",
"string",
")",
"{",
"if",
"(",
"string",
"==",
"null",
")",
"return",
"false",
";",
"EmojiParser",
".",
"UnicodeCandidate",
"unicodeCandidate",
"=",
"EmojiParser",
".",
"getNextUnicodeCandidate",
"(",
"str... | Tests if a given String is an emoji.
@param string the string to test
@return true if the string is an emoji's unicode, false else | [
"Tests",
"if",
"a",
"given",
"String",
"is",
"an",
"emoji",
"."
] | 8cf5fbe0d7c1020b926791f2b342a263ed07bb0f | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiManager.java#L128-L135 |
25,156 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/topology/base/BaseWindowedBolt.java | BaseWindowedBolt.withWindow | public BaseWindowedBolt withWindow(Count windowLength, Duration slidingInterval) {
return withWindowLength(windowLength).withSlidingInterval(slidingInterval);
} | java | public BaseWindowedBolt withWindow(Count windowLength, Duration slidingInterval) {
return withWindowLength(windowLength).withSlidingInterval(slidingInterval);
} | [
"public",
"BaseWindowedBolt",
"withWindow",
"(",
"Count",
"windowLength",
",",
"Duration",
"slidingInterval",
")",
"{",
"return",
"withWindowLength",
"(",
"windowLength",
")",
".",
"withSlidingInterval",
"(",
"slidingInterval",
")",
";",
"}"
] | Tuple count and time duration based sliding window configuration.
@param windowLength the number of tuples in the window
@param slidingInterval the time duration after which the window slides | [
"Tuple",
"count",
"and",
"time",
"duration",
"based",
"sliding",
"window",
"configuration",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/topology/base/BaseWindowedBolt.java#L100-L102 |
25,157 | alibaba/jstorm | jstorm-core/src/main/java/storm/trident/topology/state/RotatingTransactionalState.java | RotatingTransactionalState.getStateOrCreate | public Object getStateOrCreate(long txid, StateInitializer init) {
if(_curr.containsKey(txid)) {
return _curr.get(txid);
} else {
getState(txid, init);
return null;
}
} | java | public Object getStateOrCreate(long txid, StateInitializer init) {
if(_curr.containsKey(txid)) {
return _curr.get(txid);
} else {
getState(txid, init);
return null;
}
} | [
"public",
"Object",
"getStateOrCreate",
"(",
"long",
"txid",
",",
"StateInitializer",
"init",
")",
"{",
"if",
"(",
"_curr",
".",
"containsKey",
"(",
"txid",
")",
")",
"{",
"return",
"_curr",
".",
"get",
"(",
"txid",
")",
";",
"}",
"else",
"{",
"getStat... | Returns null if it was created, the value otherwise. | [
"Returns",
"null",
"if",
"it",
"was",
"created",
"the",
"value",
"otherwise",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/storm/trident/topology/state/RotatingTransactionalState.java#L105-L112 |
25,158 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/spout/CheckPointState.java | CheckPointState.nextState | public CheckPointState nextState(boolean recovering) {
CheckPointState nextState;
switch (state) {
case PREPARING:
nextState = recovering ? new CheckPointState(txid - 1, State.COMMITTED) : new CheckPointState(txid, State.COMMITTING);
break;
case CO... | java | public CheckPointState nextState(boolean recovering) {
CheckPointState nextState;
switch (state) {
case PREPARING:
nextState = recovering ? new CheckPointState(txid - 1, State.COMMITTED) : new CheckPointState(txid, State.COMMITTING);
break;
case CO... | [
"public",
"CheckPointState",
"nextState",
"(",
"boolean",
"recovering",
")",
"{",
"CheckPointState",
"nextState",
";",
"switch",
"(",
"state",
")",
"{",
"case",
"PREPARING",
":",
"nextState",
"=",
"recovering",
"?",
"new",
"CheckPointState",
"(",
"txid",
"-",
... | Get the next state based on this checkpoint state.
@param recovering if in recovering phase
@return the next checkpoint state based on this state. | [
"Get",
"the",
"next",
"state",
"based",
"on",
"this",
"checkpoint",
"state",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/spout/CheckPointState.java#L100-L116 |
25,159 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/spout/CheckPointState.java | CheckPointState.nextAction | public Action nextAction(boolean recovering) {
Action action;
switch (state) {
case PREPARING:
action = recovering ? Action.ROLLBACK : Action.PREPARE;
break;
case COMMITTING:
action = Action.COMMIT;
break;
... | java | public Action nextAction(boolean recovering) {
Action action;
switch (state) {
case PREPARING:
action = recovering ? Action.ROLLBACK : Action.PREPARE;
break;
case COMMITTING:
action = Action.COMMIT;
break;
... | [
"public",
"Action",
"nextAction",
"(",
"boolean",
"recovering",
")",
"{",
"Action",
"action",
";",
"switch",
"(",
"state",
")",
"{",
"case",
"PREPARING",
":",
"action",
"=",
"recovering",
"?",
"Action",
".",
"ROLLBACK",
":",
"Action",
".",
"PREPARE",
";",
... | Get the next action to perform based on this checkpoint state.
@param recovering if in recovering phase
@return the next action to perform based on this state | [
"Get",
"the",
"next",
"action",
"to",
"perform",
"based",
"on",
"this",
"checkpoint",
"state",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/spout/CheckPointState.java#L124-L140 |
25,160 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/WorkerData.java | WorkerData.updateKryoSerializer | public void updateKryoSerializer() {
WorkerTopologyContext workerTopologyContext = contextMaker.makeWorkerTopologyContext(sysTopology);
KryoTupleDeserializer kryoTupleDeserializer = new KryoTupleDeserializer(stormConf, workerTopologyContext, workerTopologyContext.getRawTopology());
KryoTupleSeri... | java | public void updateKryoSerializer() {
WorkerTopologyContext workerTopologyContext = contextMaker.makeWorkerTopologyContext(sysTopology);
KryoTupleDeserializer kryoTupleDeserializer = new KryoTupleDeserializer(stormConf, workerTopologyContext, workerTopologyContext.getRawTopology());
KryoTupleSeri... | [
"public",
"void",
"updateKryoSerializer",
"(",
")",
"{",
"WorkerTopologyContext",
"workerTopologyContext",
"=",
"contextMaker",
".",
"makeWorkerTopologyContext",
"(",
"sysTopology",
")",
";",
"KryoTupleDeserializer",
"kryoTupleDeserializer",
"=",
"new",
"KryoTupleDeserializer... | create kryo serializer | [
"create",
"kryo",
"serializer"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/daemon/worker/WorkerData.java#L470-L477 |
25,161 | alibaba/jstorm | jstorm-utility/transaction_meta_spout/src/main/java/com/alibaba/jstorm/batch/meta/MetaSimpleClient.java | MetaSimpleClient.rebalanceMqList | public void rebalanceMqList() throws Exception {
LOG.info("Begin to do rebalance operation");
Set<MessageQueue> newMqs = getMQ();
Set<MessageQueue> oldMqs = currentOffsets.keySet();
if (oldMqs.equals(newMqs) == true) {
LOG.info("No change of meta queues " + newMqs);
return ;
}
Set<MessageQueu... | java | public void rebalanceMqList() throws Exception {
LOG.info("Begin to do rebalance operation");
Set<MessageQueue> newMqs = getMQ();
Set<MessageQueue> oldMqs = currentOffsets.keySet();
if (oldMqs.equals(newMqs) == true) {
LOG.info("No change of meta queues " + newMqs);
return ;
}
Set<MessageQueu... | [
"public",
"void",
"rebalanceMqList",
"(",
")",
"throws",
"Exception",
"{",
"LOG",
".",
"info",
"(",
"\"Begin to do rebalance operation\"",
")",
";",
"Set",
"<",
"MessageQueue",
">",
"newMqs",
"=",
"getMQ",
"(",
")",
";",
"Set",
"<",
"MessageQueue",
">",
"old... | rebalanceMqList must run after commit
@throws MQClientException | [
"rebalanceMqList",
"must",
"run",
"after",
"commit"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/transaction_meta_spout/src/main/java/com/alibaba/jstorm/batch/meta/MetaSimpleClient.java#L270-L304 |
25,162 | alibaba/jstorm | jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/model/TopologyDef.java | TopologyDef.addAllBolts | public void addAllBolts(List<BoltDef> bolts, boolean override){
for(BoltDef bolt : bolts){
String id = bolt.getId();
if(this.boltMap.get(id) == null || override) {
this.boltMap.put(bolt.getId(), bolt);
} else {
LOG.warn("Ignoring attempt to cre... | java | public void addAllBolts(List<BoltDef> bolts, boolean override){
for(BoltDef bolt : bolts){
String id = bolt.getId();
if(this.boltMap.get(id) == null || override) {
this.boltMap.put(bolt.getId(), bolt);
} else {
LOG.warn("Ignoring attempt to cre... | [
"public",
"void",
"addAllBolts",
"(",
"List",
"<",
"BoltDef",
">",
"bolts",
",",
"boolean",
"override",
")",
"{",
"for",
"(",
"BoltDef",
"bolt",
":",
"bolts",
")",
"{",
"String",
"id",
"=",
"bolt",
".",
"getId",
"(",
")",
";",
"if",
"(",
"this",
".... | used by includes implementation | [
"used",
"by",
"includes",
"implementation"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-utility/jstorm-flux/flux-core/src/main/java/com/alibaba/jstorm/flux/model/TopologyDef.java#L150-L159 |
25,163 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/window/EventTimeTrigger.java | EventTimeTrigger.onElement | @Override
public TriggerResult onElement(Object element, long timestamp, TimeWindow window, TriggerContext ctx) {
ctx.registerEventTimeTimer(window.getEnd() + ctx.getMaxLagMs(), window);
return TriggerResult.CONTINUE;
} | java | @Override
public TriggerResult onElement(Object element, long timestamp, TimeWindow window, TriggerContext ctx) {
ctx.registerEventTimeTimer(window.getEnd() + ctx.getMaxLagMs(), window);
return TriggerResult.CONTINUE;
} | [
"@",
"Override",
"public",
"TriggerResult",
"onElement",
"(",
"Object",
"element",
",",
"long",
"timestamp",
",",
"TimeWindow",
"window",
",",
"TriggerContext",
"ctx",
")",
"{",
"ctx",
".",
"registerEventTimeTimer",
"(",
"window",
".",
"getEnd",
"(",
")",
"+",... | If a watermark arrives, we need to check all pending windows.
If any of the pending window suffices, we should fire immediately by registering a timer without delay.
Otherwise we register a timer whose time is the window end plus max lag time | [
"If",
"a",
"watermark",
"arrives",
"we",
"need",
"to",
"check",
"all",
"pending",
"windows",
".",
"If",
"any",
"of",
"the",
"pending",
"window",
"suffices",
"we",
"should",
"fire",
"immediately",
"by",
"registering",
"a",
"timer",
"without",
"delay",
".",
... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/window/EventTimeTrigger.java#L32-L36 |
25,164 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/StormConfig.java | StormConfig.drpcPids | public static String drpcPids(Map conf) throws IOException {
String ret = drpc_local_dir(conf) + FILE_SEPERATEOR + "pids";
try {
FileUtils.forceMkdir(new File(ret));
} catch (IOException e) {
LOG.error("Failed to create dir " + ret, e);
throw e;
}
... | java | public static String drpcPids(Map conf) throws IOException {
String ret = drpc_local_dir(conf) + FILE_SEPERATEOR + "pids";
try {
FileUtils.forceMkdir(new File(ret));
} catch (IOException e) {
LOG.error("Failed to create dir " + ret, e);
throw e;
}
... | [
"public",
"static",
"String",
"drpcPids",
"(",
"Map",
"conf",
")",
"throws",
"IOException",
"{",
"String",
"ret",
"=",
"drpc_local_dir",
"(",
"conf",
")",
"+",
"FILE_SEPERATEOR",
"+",
"\"pids\"",
";",
"try",
"{",
"FileUtils",
".",
"forceMkdir",
"(",
"new",
... | Return drpc's pid dir | [
"Return",
"drpc",
"s",
"pid",
"dir"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/StormConfig.java#L224-L233 |
25,165 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/StormConfig.java | StormConfig.read_supervisor_topology_conf | public static Map read_supervisor_topology_conf(Map conf, String topologyId) throws IOException {
String topologyRoot = StormConfig.supervisor_stormdist_root(conf, topologyId);
String confPath = StormConfig.stormconf_path(topologyRoot);
return (Map) readLocalObject(topologyId, confPath);
} | java | public static Map read_supervisor_topology_conf(Map conf, String topologyId) throws IOException {
String topologyRoot = StormConfig.supervisor_stormdist_root(conf, topologyId);
String confPath = StormConfig.stormconf_path(topologyRoot);
return (Map) readLocalObject(topologyId, confPath);
} | [
"public",
"static",
"Map",
"read_supervisor_topology_conf",
"(",
"Map",
"conf",
",",
"String",
"topologyId",
")",
"throws",
"IOException",
"{",
"String",
"topologyRoot",
"=",
"StormConfig",
".",
"supervisor_stormdist_root",
"(",
"conf",
",",
"topologyId",
")",
";",
... | merge storm conf into cluster conf | [
"merge",
"storm",
"conf",
"into",
"cluster",
"conf"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/StormConfig.java#L449-L453 |
25,166 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/IsolatedPool.java | IsolatedPool.getNodesForIsolatedTop | private int getNodesForIsolatedTop(TopologyDetails td, Set<Node> allNodes, NodePool[] lesserPools, int nodesRequested) {
String topId = td.getId();
LOG.debug("Topology {} is isolated", topId);
int nodesFromUsAvailable = nodesAvailable();
int nodesFromOthersAvailable = NodePool.nodesAvail... | java | private int getNodesForIsolatedTop(TopologyDetails td, Set<Node> allNodes, NodePool[] lesserPools, int nodesRequested) {
String topId = td.getId();
LOG.debug("Topology {} is isolated", topId);
int nodesFromUsAvailable = nodesAvailable();
int nodesFromOthersAvailable = NodePool.nodesAvail... | [
"private",
"int",
"getNodesForIsolatedTop",
"(",
"TopologyDetails",
"td",
",",
"Set",
"<",
"Node",
">",
"allNodes",
",",
"NodePool",
"[",
"]",
"lesserPools",
",",
"int",
"nodesRequested",
")",
"{",
"String",
"topId",
"=",
"td",
".",
"getId",
"(",
")",
";",... | Get the nodes needed to schedule an isolated topology.
@param td the topology to be scheduled
@param allNodes the nodes already scheduled for this topology. This will be updated to include new nodes if needed.
@param lesserPools node pools we can steal nodes from
@return the number of additional slots that... | [
"Get",
"the",
"nodes",
"needed",
"to",
"schedule",
"an",
"isolated",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/IsolatedPool.java#L146-L192 |
25,167 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/IsolatedPool.java | IsolatedPool.getNodesForNotIsolatedTop | private int getNodesForNotIsolatedTop(TopologyDetails td, Set<Node> allNodes, NodePool[] lesserPools) {
String topId = td.getId();
LOG.debug("Topology {} is not isolated", topId);
int totalTasks = td.getExecutors().size();
int origRequest = td.getNumWorkers();
int slotsRequested ... | java | private int getNodesForNotIsolatedTop(TopologyDetails td, Set<Node> allNodes, NodePool[] lesserPools) {
String topId = td.getId();
LOG.debug("Topology {} is not isolated", topId);
int totalTasks = td.getExecutors().size();
int origRequest = td.getNumWorkers();
int slotsRequested ... | [
"private",
"int",
"getNodesForNotIsolatedTop",
"(",
"TopologyDetails",
"td",
",",
"Set",
"<",
"Node",
">",
"allNodes",
",",
"NodePool",
"[",
"]",
"lesserPools",
")",
"{",
"String",
"topId",
"=",
"td",
".",
"getId",
"(",
")",
";",
"LOG",
".",
"debug",
"("... | Get the nodes needed to schedule a non-isolated topology.
@param td the topology to be scheduled
@param allNodes the nodes already scheduled for this topology. This will be updated to include new nodes if needed.
@param lesserPools node pools we can steal nodes from
@return the number of additional slots t... | [
"Get",
"the",
"nodes",
"needed",
"to",
"schedule",
"a",
"non",
"-",
"isolated",
"topology",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/scheduler/multitenant/IsolatedPool.java#L202-L235 |
25,168 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/MessageBatch.java | MessageBatch.tryAdd | boolean tryAdd(TaskMessage taskMsg) {
if ((encodedLength + msgEncodeLength(taskMsg)) > buffer_size)
return false;
add(taskMsg);
return true;
} | java | boolean tryAdd(TaskMessage taskMsg) {
if ((encodedLength + msgEncodeLength(taskMsg)) > buffer_size)
return false;
add(taskMsg);
return true;
} | [
"boolean",
"tryAdd",
"(",
"TaskMessage",
"taskMsg",
")",
"{",
"if",
"(",
"(",
"encodedLength",
"+",
"msgEncodeLength",
"(",
"taskMsg",
")",
")",
">",
"buffer_size",
")",
"return",
"false",
";",
"add",
"(",
"taskMsg",
")",
";",
"return",
"true",
";",
"}"
... | try to add a TaskMessage to a batch
@param taskMsg task message
@return false if the msg could not be added due to buffer size limit; true otherwise | [
"try",
"to",
"add",
"a",
"TaskMessage",
"to",
"a",
"batch"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/MessageBatch.java#L129-L134 |
25,169 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/MessageBatch.java | MessageBatch.writeTaskMessage | private void writeTaskMessage(ChannelBufferOutputStream bout, TaskMessage message) throws Exception {
int payload_len = 0;
if (message.message() != null)
payload_len = message.message().length;
short type = message.get_type();
bout.writeShort(type);
int task_id = me... | java | private void writeTaskMessage(ChannelBufferOutputStream bout, TaskMessage message) throws Exception {
int payload_len = 0;
if (message.message() != null)
payload_len = message.message().length;
short type = message.get_type();
bout.writeShort(type);
int task_id = me... | [
"private",
"void",
"writeTaskMessage",
"(",
"ChannelBufferOutputStream",
"bout",
",",
"TaskMessage",
"message",
")",
"throws",
"Exception",
"{",
"int",
"payload_len",
"=",
"0",
";",
"if",
"(",
"message",
".",
"message",
"(",
")",
"!=",
"null",
")",
"payload_le... | write a TaskMessage into a stream
Each TaskMessage is encoded as: task ... short(2) len ... int(4) payload ... byte[] * | [
"write",
"a",
"TaskMessage",
"into",
"a",
"stream"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/message/netty/MessageBatch.java#L205-L224 |
25,170 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/ClientBlobStore.java | ClientBlobStore.createBlob | public final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws KeyAlreadyExistsException {
return createBlobToExtend(key, meta);
} | java | public final AtomicOutputStream createBlob(String key, SettableBlobMeta meta) throws KeyAlreadyExistsException {
return createBlobToExtend(key, meta);
} | [
"public",
"final",
"AtomicOutputStream",
"createBlob",
"(",
"String",
"key",
",",
"SettableBlobMeta",
"meta",
")",
"throws",
"KeyAlreadyExistsException",
"{",
"return",
"createBlobToExtend",
"(",
"key",
",",
"meta",
")",
";",
"}"
] | Client facing API to create a blob.
@param key blob key name.
@param meta contains ACL information.
@return AtomicOutputStream returns an output stream into which data can be written.
@throws AuthorizationException
@throws KeyAlreadyExistsException | [
"Client",
"facing",
"API",
"to",
"create",
"a",
"blob",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/ClientBlobStore.java#L157-L159 |
25,171 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/ClientBlobStore.java | ClientBlobStore.setBlobMeta | public final void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException {
setBlobMetaToExtend(key, meta);
} | java | public final void setBlobMeta(String key, SettableBlobMeta meta) throws AuthorizationException, KeyNotFoundException {
setBlobMetaToExtend(key, meta);
} | [
"public",
"final",
"void",
"setBlobMeta",
"(",
"String",
"key",
",",
"SettableBlobMeta",
"meta",
")",
"throws",
"AuthorizationException",
",",
"KeyNotFoundException",
"{",
"setBlobMetaToExtend",
"(",
"key",
",",
"meta",
")",
";",
"}"
] | Client facing API to set the metadata for a blob.
@param key blob key name.
@param meta contains ACL information.
@throws AuthorizationException
@throws KeyNotFoundException | [
"Client",
"facing",
"API",
"to",
"set",
"the",
"metadata",
"for",
"a",
"blob",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/ClientBlobStore.java#L168-L170 |
25,172 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.downloadMissingBlob | public static boolean downloadMissingBlob(Map conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos)
throws TTransportException {
NimbusClient client;
ReadableBlobMeta rbm;
ClientBlobStore remoteBlobStore;
InputStreamWithMeta in;
boolean isSuccess = false... | java | public static boolean downloadMissingBlob(Map conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos)
throws TTransportException {
NimbusClient client;
ReadableBlobMeta rbm;
ClientBlobStore remoteBlobStore;
InputStreamWithMeta in;
boolean isSuccess = false... | [
"public",
"static",
"boolean",
"downloadMissingBlob",
"(",
"Map",
"conf",
",",
"BlobStore",
"blobStore",
",",
"String",
"key",
",",
"Set",
"<",
"NimbusInfo",
">",
"nimbusInfos",
")",
"throws",
"TTransportException",
"{",
"NimbusClient",
"client",
";",
"ReadableBlo... | Download missing blobs from potential nimbodes | [
"Download",
"missing",
"blobs",
"from",
"potential",
"nimbodes"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L124-L171 |
25,173 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.downloadUpdatedBlob | public static boolean downloadUpdatedBlob(Map conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos)
throws TTransportException {
NimbusClient client;
ClientBlobStore remoteBlobStore;
boolean isSuccess = false;
LOG.debug("Download blob NimbusInfos {}", nimbusInfo... | java | public static boolean downloadUpdatedBlob(Map conf, BlobStore blobStore, String key, Set<NimbusInfo> nimbusInfos)
throws TTransportException {
NimbusClient client;
ClientBlobStore remoteBlobStore;
boolean isSuccess = false;
LOG.debug("Download blob NimbusInfos {}", nimbusInfo... | [
"public",
"static",
"boolean",
"downloadUpdatedBlob",
"(",
"Map",
"conf",
",",
"BlobStore",
"blobStore",
",",
"String",
"key",
",",
"Set",
"<",
"NimbusInfo",
">",
"nimbusInfos",
")",
"throws",
"TTransportException",
"{",
"NimbusClient",
"client",
";",
"ClientBlobS... | Download updated blobs from potential nimbodes | [
"Download",
"updated",
"blobs",
"from",
"potential",
"nimbodes"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L206-L238 |
25,174 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.getKeyListFromBlobStore | public static List<String> getKeyListFromBlobStore(BlobStore blobStore) throws Exception {
Iterator<String> keys = blobStore.listKeys();
List<String> keyList = new ArrayList<String>();
if (keys != null) {
while (keys.hasNext()) {
keyList.add(keys.next());
... | java | public static List<String> getKeyListFromBlobStore(BlobStore blobStore) throws Exception {
Iterator<String> keys = blobStore.listKeys();
List<String> keyList = new ArrayList<String>();
if (keys != null) {
while (keys.hasNext()) {
keyList.add(keys.next());
... | [
"public",
"static",
"List",
"<",
"String",
">",
"getKeyListFromBlobStore",
"(",
"BlobStore",
"blobStore",
")",
"throws",
"Exception",
"{",
"Iterator",
"<",
"String",
">",
"keys",
"=",
"blobStore",
".",
"listKeys",
"(",
")",
";",
"List",
"<",
"String",
">",
... | Get the list of keys from blobstore | [
"Get",
"the",
"list",
"of",
"keys",
"from",
"blobstore"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L241-L251 |
25,175 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.filterAndListKeys | public static <R> Set<R> filterAndListKeys(Iterator<R> keys, KeyFilter<R> filter) {
Set<R> ret = new HashSet<R>();
while (keys.hasNext()) {
R key = keys.next();
R filtered = filter.filter(key);
if (filtered != null) {
ret.add(filtered);
}
... | java | public static <R> Set<R> filterAndListKeys(Iterator<R> keys, KeyFilter<R> filter) {
Set<R> ret = new HashSet<R>();
while (keys.hasNext()) {
R key = keys.next();
R filtered = filter.filter(key);
if (filtered != null) {
ret.add(filtered);
}
... | [
"public",
"static",
"<",
"R",
">",
"Set",
"<",
"R",
">",
"filterAndListKeys",
"(",
"Iterator",
"<",
"R",
">",
"keys",
",",
"KeyFilter",
"<",
"R",
">",
"filter",
")",
"{",
"Set",
"<",
"R",
">",
"ret",
"=",
"new",
"HashSet",
"<",
"R",
">",
"(",
"... | Filters keys based on the KeyFilter
passed as the argument.
@param filter KeyFilter
@param <R> Type
@return Set of filtered keys | [
"Filters",
"keys",
"based",
"on",
"the",
"KeyFilter",
"passed",
"as",
"the",
"argument",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L449-L459 |
25,176 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.cleanup_key | public static void cleanup_key(String blobKey, BlobStore blobStore, StormClusterState clusterState) {
// we skip to clean up the non-exist keys
if (blobKey.startsWith(JStormMetrics.NIMBUS_METRIC_KEY)
|| blobKey.startsWith(JStormMetrics.CLUSTER_METRIC_KEY)
|| blobKey.start... | java | public static void cleanup_key(String blobKey, BlobStore blobStore, StormClusterState clusterState) {
// we skip to clean up the non-exist keys
if (blobKey.startsWith(JStormMetrics.NIMBUS_METRIC_KEY)
|| blobKey.startsWith(JStormMetrics.CLUSTER_METRIC_KEY)
|| blobKey.start... | [
"public",
"static",
"void",
"cleanup_key",
"(",
"String",
"blobKey",
",",
"BlobStore",
"blobStore",
",",
"StormClusterState",
"clusterState",
")",
"{",
"// we skip to clean up the non-exist keys",
"if",
"(",
"blobKey",
".",
"startsWith",
"(",
"JStormMetrics",
".",
"NI... | remove blob information in zk for the blobkey | [
"remove",
"blob",
"information",
"in",
"zk",
"for",
"the",
"blobkey"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L488-L509 |
25,177 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java | BlobStoreUtils.downloadDistributeStormCode | public static void downloadDistributeStormCode(Map conf, String topologyId, String masterCodeDir)
throws IOException, TException {
String tmpToot = null;
try {
// STORM_LOCAL_DIR/supervisor/tmp/(UUID)
tmpToot = StormConfig.supervisorTmpDir(conf) + File.separator + UUI... | java | public static void downloadDistributeStormCode(Map conf, String topologyId, String masterCodeDir)
throws IOException, TException {
String tmpToot = null;
try {
// STORM_LOCAL_DIR/supervisor/tmp/(UUID)
tmpToot = StormConfig.supervisorTmpDir(conf) + File.separator + UUI... | [
"public",
"static",
"void",
"downloadDistributeStormCode",
"(",
"Map",
"conf",
",",
"String",
"topologyId",
",",
"String",
"masterCodeDir",
")",
"throws",
"IOException",
",",
"TException",
"{",
"String",
"tmpToot",
"=",
"null",
";",
"try",
"{",
"// STORM_LOCAL_DIR... | no need to synchronize, since EventManager will execute sequentially | [
"no",
"need",
"to",
"synchronize",
"since",
"EventManager",
"will",
"execute",
"sequentially"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/blobstore/BlobStoreUtils.java#L566-L599 |
25,178 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/LogUtils.java | LogUtils.setLogBackLevel | public static boolean setLogBackLevel(String loggerName, String logLevel) {
String logLevelUpper = (logLevel == null) ? "OFF" : logLevel.toUpperCase();
try {
Package logbackPackage = Package.getPackage(LOGBACK_CLASSIC);
if (logbackPackage == null) {
LOG.warn("Logb... | java | public static boolean setLogBackLevel(String loggerName, String logLevel) {
String logLevelUpper = (logLevel == null) ? "OFF" : logLevel.toUpperCase();
try {
Package logbackPackage = Package.getPackage(LOGBACK_CLASSIC);
if (logbackPackage == null) {
LOG.warn("Logb... | [
"public",
"static",
"boolean",
"setLogBackLevel",
"(",
"String",
"loggerName",
",",
"String",
"logLevel",
")",
"{",
"String",
"logLevelUpper",
"=",
"(",
"logLevel",
"==",
"null",
")",
"?",
"\"OFF\"",
":",
"logLevel",
".",
"toUpperCase",
"(",
")",
";",
"try",... | Dynamically sets the logback log level for the given class to the specified level.
@param loggerName Name of the logger to set its log level. If blank, root logger will be used.
@param logLevel One of the supported log levels: TRACE, DEBUG, INFO, WARN, ERROR, FATAL,
OFF. {@code null} value is considered as 'OFF'. | [
"Dynamically",
"sets",
"the",
"logback",
"log",
"level",
"for",
"the",
"given",
"class",
"to",
"the",
"specified",
"level",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/LogUtils.java#L93-L137 |
25,179 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/LogUtils.java | LogUtils.setLog4jLevel | public static boolean setLog4jLevel(String loggerName, String logLevel) {
String logLevelUpper = (logLevel == null) ? "OFF" : logLevel.toUpperCase();
try {
Package log4jPackage = Package.getPackage(LOG4J_CLASSIC);
if (log4jPackage == null) {
LOG.warn("Log4j is not... | java | public static boolean setLog4jLevel(String loggerName, String logLevel) {
String logLevelUpper = (logLevel == null) ? "OFF" : logLevel.toUpperCase();
try {
Package log4jPackage = Package.getPackage(LOG4J_CLASSIC);
if (log4jPackage == null) {
LOG.warn("Log4j is not... | [
"public",
"static",
"boolean",
"setLog4jLevel",
"(",
"String",
"loggerName",
",",
"String",
"logLevel",
")",
"{",
"String",
"logLevelUpper",
"=",
"(",
"logLevel",
"==",
"null",
")",
"?",
"\"OFF\"",
":",
"logLevel",
".",
"toUpperCase",
"(",
")",
";",
"try",
... | Dynamically sets the log4j log level for the given class to the specified level.
@param loggerName Name of the logger to set its log level. If blank, root logger will be used.
@param logLevel One of the supported log levels: TRACE, DEBUG, INFO, WARN, ERROR, FATAL,
OFF. {@code null} value is considered as 'OFF'. | [
"Dynamically",
"sets",
"the",
"log4j",
"log",
"level",
"for",
"the",
"given",
"class",
"to",
"the",
"specified",
"level",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/LogUtils.java#L146-L196 |
25,180 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/serialization/KryoTupleDeserializer.java | KryoTupleDeserializer.deserializeTaskId | public static int deserializeTaskId(byte[] ser) {
Input _kryoInput = new Input(1);
_kryoInput.setBuffer(ser);
return _kryoInput.readInt();
} | java | public static int deserializeTaskId(byte[] ser) {
Input _kryoInput = new Input(1);
_kryoInput.setBuffer(ser);
return _kryoInput.readInt();
} | [
"public",
"static",
"int",
"deserializeTaskId",
"(",
"byte",
"[",
"]",
"ser",
")",
"{",
"Input",
"_kryoInput",
"=",
"new",
"Input",
"(",
"1",
")",
";",
"_kryoInput",
".",
"setBuffer",
"(",
"ser",
")",
";",
"return",
"_kryoInput",
".",
"readInt",
"(",
"... | just get target taskId | [
"just",
"get",
"target",
"taskId"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/serialization/KryoTupleDeserializer.java#L143-L148 |
25,181 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.isPortAvailable | public static boolean isPortAvailable(int port) {
try {
ServerSocket socket = new ServerSocket(port);
socket.close();
return true;
} catch (IOException e) {
return false;
}
} | java | public static boolean isPortAvailable(int port) {
try {
ServerSocket socket = new ServerSocket(port);
socket.close();
return true;
} catch (IOException e) {
return false;
}
} | [
"public",
"static",
"boolean",
"isPortAvailable",
"(",
"int",
"port",
")",
"{",
"try",
"{",
"ServerSocket",
"socket",
"=",
"new",
"ServerSocket",
"(",
"port",
")",
";",
"socket",
".",
"close",
"(",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"I... | See if a port is available for listening on by trying to listen
on it and seeing if that works or fails.
@param port port to listen to
@return true if the port was available for listening on | [
"See",
"if",
"a",
"port",
"is",
"available",
"for",
"listening",
"on",
"by",
"trying",
"to",
"listen",
"on",
"it",
"and",
"seeing",
"if",
"that",
"works",
"or",
"fails",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L103-L111 |
25,182 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.isPortAvailable | public static boolean isPortAvailable(String host, int port) {
try {
Socket socket = new Socket(host, port);
socket.close();
return false;
} catch (IOException e) {
return true;
}
} | java | public static boolean isPortAvailable(String host, int port) {
try {
Socket socket = new Socket(host, port);
socket.close();
return false;
} catch (IOException e) {
return true;
}
} | [
"public",
"static",
"boolean",
"isPortAvailable",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"try",
"{",
"Socket",
"socket",
"=",
"new",
"Socket",
"(",
"host",
",",
"port",
")",
";",
"socket",
".",
"close",
"(",
")",
";",
"return",
"false",
... | See if a port is available for listening on by trying connect to it
and seeing if that works or fails
@param host
@param port
@return | [
"See",
"if",
"a",
"port",
"is",
"available",
"for",
"listening",
"on",
"by",
"trying",
"connect",
"to",
"it",
"and",
"seeing",
"if",
"that",
"works",
"or",
"fails"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L121-L129 |
25,183 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.patchConfiguration | public static Configuration patchConfiguration(Configuration conf) {
//if the fallback option is NOT set, enable it.
//if it is explicitly set to anything -leave alone
if (conf.get(JstormXmlConfKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH) == null) {
conf.set(JstormXmlConfKeys.IPC_CLIENT... | java | public static Configuration patchConfiguration(Configuration conf) {
//if the fallback option is NOT set, enable it.
//if it is explicitly set to anything -leave alone
if (conf.get(JstormXmlConfKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH) == null) {
conf.set(JstormXmlConfKeys.IPC_CLIENT... | [
"public",
"static",
"Configuration",
"patchConfiguration",
"(",
"Configuration",
"conf",
")",
"{",
"//if the fallback option is NOT set, enable it.",
"//if it is explicitly set to anything -leave alone",
"if",
"(",
"conf",
".",
"get",
"(",
"JstormXmlConfKeys",
".",
"IPC_CLIENT_... | Take an existing conf and patch it for needs. Useful
in Service.init & RunService methods where a shared config is being
passed in
@param conf configuration
@return the patched configuration | [
"Take",
"an",
"existing",
"conf",
"and",
"patch",
"it",
"for",
"needs",
".",
"Useful",
"in",
"Service",
".",
"init",
"&",
"RunService",
"methods",
"where",
"a",
"shared",
"config",
"is",
"being",
"passed",
"in"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L158-L166 |
25,184 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.collectionToStringList | public static List<String> collectionToStringList(Collection c) {
List<String> l = new ArrayList<String>(c.size());
for (Object o : c) {
l.add(o.toString());
}
return l;
} | java | public static List<String> collectionToStringList(Collection c) {
List<String> l = new ArrayList<String>(c.size());
for (Object o : c) {
l.add(o.toString());
}
return l;
} | [
"public",
"static",
"List",
"<",
"String",
">",
"collectionToStringList",
"(",
"Collection",
"c",
")",
"{",
"List",
"<",
"String",
">",
"l",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"c",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Object",... | Take a collection, return a list containing the string value of every
element in the collection.
@param c collection
@return a stringified list | [
"Take",
"a",
"collection",
"return",
"a",
"list",
"containing",
"the",
"string",
"value",
"of",
"every",
"element",
"in",
"the",
"collection",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L175-L181 |
25,185 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.join | public static String join(Collection collection, String separator) {
return join(collection, separator, true);
} | java | public static String join(Collection collection, String separator) {
return join(collection, separator, true);
} | [
"public",
"static",
"String",
"join",
"(",
"Collection",
"collection",
",",
"String",
"separator",
")",
"{",
"return",
"join",
"(",
"collection",
",",
"separator",
",",
"true",
")",
";",
"}"
] | Join an collection of objects with a separator that appears after every
instance in the list -including at the end
@param collection collection to call toString() on each element
@param separator separator string
@return the joined entries | [
"Join",
"an",
"collection",
"of",
"objects",
"with",
"a",
"separator",
"that",
"appears",
"after",
"every",
"instance",
"in",
"the",
"list",
"-",
"including",
"at",
"the",
"end"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L191-L193 |
25,186 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.join | public static String join(Collection collection,
String separator,
boolean trailing) {
StringBuilder b = new StringBuilder();
// fast return on empty collection
if (collection.isEmpty()) {
return trailing ? separator : "";
... | java | public static String join(Collection collection,
String separator,
boolean trailing) {
StringBuilder b = new StringBuilder();
// fast return on empty collection
if (collection.isEmpty()) {
return trailing ? separator : "";
... | [
"public",
"static",
"String",
"join",
"(",
"Collection",
"collection",
",",
"String",
"separator",
",",
"boolean",
"trailing",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"// fast return on empty collection",
"if",
"(",
"collection"... | Join an collection of objects with a separator that appears after every
instance in the list -optionally at the end
@param collection collection to call toString() on each element
@param separator separator string
@param trailing add a trailing entry or not
@return the joined entries | [
"Join",
"an",
"collection",
"of",
"objects",
"with",
"a",
"separator",
"that",
"appears",
"after",
"every",
"instance",
"in",
"the",
"list",
"-",
"optionally",
"at",
"the",
"end"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L204-L220 |
25,187 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.join | public static String join(String[] collection, String separator,
boolean trailing) {
return join(Arrays.asList(collection), separator, trailing);
} | java | public static String join(String[] collection, String separator,
boolean trailing) {
return join(Arrays.asList(collection), separator, trailing);
} | [
"public",
"static",
"String",
"join",
"(",
"String",
"[",
"]",
"collection",
",",
"String",
"separator",
",",
"boolean",
"trailing",
")",
"{",
"return",
"join",
"(",
"Arrays",
".",
"asList",
"(",
"collection",
")",
",",
"separator",
",",
"trailing",
")",
... | Join an array of strings with a separator that appears after every
instance in the list -optionally at the end
@param collection strings
@param separator separator string
@param trailing add a trailing entry or not
@return the joined entries | [
"Join",
"an",
"array",
"of",
"strings",
"with",
"a",
"separator",
"that",
"appears",
"after",
"every",
"instance",
"in",
"the",
"list",
"-",
"optionally",
"at",
"the",
"end"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L245-L248 |
25,188 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.joinWithInnerSeparator | public static String joinWithInnerSeparator(String separator,
Object... collection) {
StringBuilder b = new StringBuilder();
boolean first = true;
for (Object o : collection) {
if (first) {
first = false;
} ... | java | public static String joinWithInnerSeparator(String separator,
Object... collection) {
StringBuilder b = new StringBuilder();
boolean first = true;
for (Object o : collection) {
if (first) {
first = false;
} ... | [
"public",
"static",
"String",
"joinWithInnerSeparator",
"(",
"String",
"separator",
",",
"Object",
"...",
"collection",
")",
"{",
"StringBuilder",
"b",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
";",
"for",
"(",
"Object",
"o... | Join an array of strings with a separator that appears after every
instance in the list -except at the end
@param collection strings
@param separator separator string
@return the list | [
"Join",
"an",
"array",
"of",
"strings",
"with",
"a",
"separator",
"that",
"appears",
"after",
"every",
"instance",
"in",
"the",
"list",
"-",
"except",
"at",
"the",
"end"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L258-L273 |
25,189 | alibaba/jstorm | jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java | JstormYarnUtils.getSupervisorSlotPorts | public static String getSupervisorSlotPorts(int memory, int vcores, String instanceName, String supervisorHost, RegistryOperations registryOperations) {
return join(getSupervisorPorts(memory, vcores, instanceName, supervisorHost, registryOperations), JOYConstants.COMMA, false);
} | java | public static String getSupervisorSlotPorts(int memory, int vcores, String instanceName, String supervisorHost, RegistryOperations registryOperations) {
return join(getSupervisorPorts(memory, vcores, instanceName, supervisorHost, registryOperations), JOYConstants.COMMA, false);
} | [
"public",
"static",
"String",
"getSupervisorSlotPorts",
"(",
"int",
"memory",
",",
"int",
"vcores",
",",
"String",
"instanceName",
",",
"String",
"supervisorHost",
",",
"RegistryOperations",
"registryOperations",
")",
"{",
"return",
"join",
"(",
"getSupervisorPorts",
... | this is for jstorm configuration's format
@param memory
@param vcores
@param supervisorHost
@return | [
"this",
"is",
"for",
"jstorm",
"configuration",
"s",
"format"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-on-yarn/src/main/java/com/alibaba/jstorm/yarn/utils/JstormYarnUtils.java#L283-L285 |
25,190 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WatermarkTimeTriggerPolicy.java | WatermarkTimeTriggerPolicy.getNextAlignedWindowTs | private long getNextAlignedWindowTs(long startTs, long endTs) {
long nextTs = windowManager.getEarliestEventTs(startTs, endTs);
if (nextTs == Long.MAX_VALUE || (nextTs % slidingIntervalMs == 0)) {
return nextTs;
}
return nextTs + (slidingIntervalMs - (nextTs % slidingInterval... | java | private long getNextAlignedWindowTs(long startTs, long endTs) {
long nextTs = windowManager.getEarliestEventTs(startTs, endTs);
if (nextTs == Long.MAX_VALUE || (nextTs % slidingIntervalMs == 0)) {
return nextTs;
}
return nextTs + (slidingIntervalMs - (nextTs % slidingInterval... | [
"private",
"long",
"getNextAlignedWindowTs",
"(",
"long",
"startTs",
",",
"long",
"endTs",
")",
"{",
"long",
"nextTs",
"=",
"windowManager",
".",
"getEarliestEventTs",
"(",
"startTs",
",",
"endTs",
")",
";",
"if",
"(",
"nextTs",
"==",
"Long",
".",
"MAX_VALUE... | Computes the next window by scanning the events in the window and
finds the next aligned window between the startTs and endTs. Return the end ts
of the next aligned window, i.e. the ts when the window should fire.
@param startTs the start timestamp (excluding)
@param endTs the end timestamp (including)
@return the ali... | [
"Computes",
"the",
"next",
"window",
"by",
"scanning",
"the",
"events",
"in",
"the",
"window",
"and",
"finds",
"the",
"next",
"aligned",
"window",
"between",
"the",
"startTs",
"and",
"endTs",
".",
"Return",
"the",
"end",
"ts",
"of",
"the",
"next",
"aligned... | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WatermarkTimeTriggerPolicy.java#L109-L115 |
25,191 | alibaba/jstorm | jstorm-core/src/main/java/backtype/storm/windowing/WaterMarkEventGenerator.java | WaterMarkEventGenerator.computeWaterMarkTs | private long computeWaterMarkTs() {
long ts = 0;
// only if some data has arrived on each input stream
if (streamToTs.size() >= inputStreams.size()) {
ts = Long.MAX_VALUE;
for (Map.Entry<GlobalStreamId, Long> entry : streamToTs.entrySet()) {
ts = Math.min(... | java | private long computeWaterMarkTs() {
long ts = 0;
// only if some data has arrived on each input stream
if (streamToTs.size() >= inputStreams.size()) {
ts = Long.MAX_VALUE;
for (Map.Entry<GlobalStreamId, Long> entry : streamToTs.entrySet()) {
ts = Math.min(... | [
"private",
"long",
"computeWaterMarkTs",
"(",
")",
"{",
"long",
"ts",
"=",
"0",
";",
"// only if some data has arrived on each input stream",
"if",
"(",
"streamToTs",
".",
"size",
"(",
")",
">=",
"inputStreams",
".",
"size",
"(",
")",
")",
"{",
"ts",
"=",
"L... | Computes the min ts across all streams. | [
"Computes",
"the",
"min",
"ts",
"across",
"all",
"streams",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/backtype/storm/windowing/WaterMarkEventGenerator.java#L93-L103 |
25,192 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.topologyIdToName | public static String topologyIdToName(String topologyId) throws InvalidTopologyException {
String ret;
int index = topologyId.lastIndexOf('-');
if (index != -1 && index > 2) {
index = topologyId.lastIndexOf('-', index - 1);
if (index != -1 && index > 0)
re... | java | public static String topologyIdToName(String topologyId) throws InvalidTopologyException {
String ret;
int index = topologyId.lastIndexOf('-');
if (index != -1 && index > 2) {
index = topologyId.lastIndexOf('-', index - 1);
if (index != -1 && index > 0)
re... | [
"public",
"static",
"String",
"topologyIdToName",
"(",
"String",
"topologyId",
")",
"throws",
"InvalidTopologyException",
"{",
"String",
"ret",
";",
"int",
"index",
"=",
"topologyId",
".",
"lastIndexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"index",
"!=",
"-"... | Convert topologyId to topologyName. TopologyId = topoloygName-counter-timeStamp | [
"Convert",
"topologyId",
"to",
"topologyName",
".",
"TopologyId",
"=",
"topoloygName",
"-",
"counter",
"-",
"timeStamp"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L136-L148 |
25,193 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.charValidate | public static boolean charValidate(String name) {
if (name.matches("[0-9]+") || name.toLowerCase().equals("null")) {
return false;
} else {
return name.matches("[a-zA-Z0-9-_.]+");
}
} | java | public static boolean charValidate(String name) {
if (name.matches("[0-9]+") || name.toLowerCase().equals("null")) {
return false;
} else {
return name.matches("[a-zA-Z0-9-_.]+");
}
} | [
"public",
"static",
"boolean",
"charValidate",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"matches",
"(",
"\"[0-9]+\"",
")",
"||",
"name",
".",
"toLowerCase",
"(",
")",
".",
"equals",
"(",
"\"null\"",
")",
")",
"{",
"return",
"false",
";"... | Validation of topology name chars. Only alpha char, number, '-', '_', '.' are valid. | [
"Validation",
"of",
"topology",
"name",
"chars",
".",
"Only",
"alpha",
"char",
"number",
"-",
"_",
".",
"are",
"valid",
"."
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L153-L159 |
25,194 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.validate_ids | @SuppressWarnings("unchecked")
public static void validate_ids(StormTopology topology, String topologyId) throws InvalidTopologyException {
String topologyName = topologyIdToName(topologyId);
if (!charValidate(topologyName)) {
throw new InvalidTopologyException(topologyName + " is not a ... | java | @SuppressWarnings("unchecked")
public static void validate_ids(StormTopology topology, String topologyId) throws InvalidTopologyException {
String topologyName = topologyIdToName(topologyId);
if (!charValidate(topologyName)) {
throw new InvalidTopologyException(topologyName + " is not a ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"validate_ids",
"(",
"StormTopology",
"topology",
",",
"String",
"topologyId",
")",
"throws",
"InvalidTopologyException",
"{",
"String",
"topologyName",
"=",
"topologyIdToName",
"(",
"topo... | Check Whether ID of Bolt or spout is system_id
@throws InvalidTopologyException | [
"Check",
"Whether",
"ID",
"of",
"Bolt",
"or",
"spout",
"is",
"system_id"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L173-L205 |
25,195 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.add_acker | public static void add_acker(Map stormConf, StormTopology ret) {
String key = Config.TOPOLOGY_ACKER_EXECUTORS;
Integer ackerNum = JStormUtils.parseInt(stormConf.get(key), 0);
// generate outputs
HashMap<String, StreamInfo> outputs = new HashMap<>();
ArrayList<String> fields = n... | java | public static void add_acker(Map stormConf, StormTopology ret) {
String key = Config.TOPOLOGY_ACKER_EXECUTORS;
Integer ackerNum = JStormUtils.parseInt(stormConf.get(key), 0);
// generate outputs
HashMap<String, StreamInfo> outputs = new HashMap<>();
ArrayList<String> fields = n... | [
"public",
"static",
"void",
"add_acker",
"(",
"Map",
"stormConf",
",",
"StormTopology",
"ret",
")",
"{",
"String",
"key",
"=",
"Config",
".",
"TOPOLOGY_ACKER_EXECUTORS",
";",
"Integer",
"ackerNum",
"=",
"JStormUtils",
".",
"parseInt",
"(",
"stormConf",
".",
"g... | Add acker bolt to topology | [
"Add",
"acker",
"bolt",
"to",
"topology"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L464-L521 |
25,196 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.component_conf | @SuppressWarnings("unchecked")
public static Map component_conf(TopologyContext topology_context, String component_id) {
Map<Object, Object> componentConf = new HashMap<>();
String jconf = topology_context.getComponentCommon(component_id).get_json_conf();
if (jconf != null) {
com... | java | @SuppressWarnings("unchecked")
public static Map component_conf(TopologyContext topology_context, String component_id) {
Map<Object, Object> componentConf = new HashMap<>();
String jconf = topology_context.getComponentCommon(component_id).get_json_conf();
if (jconf != null) {
com... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Map",
"component_conf",
"(",
"TopologyContext",
"topology_context",
",",
"String",
"component_id",
")",
"{",
"Map",
"<",
"Object",
",",
"Object",
">",
"componentConf",
"=",
"new",
"HashMap",
... | get component configuration | [
"get",
"component",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L635-L644 |
25,197 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.get_task_object | public static Object get_task_object(StormTopology topology, String component_id, URLClassLoader loader) {
Map<String, SpoutSpec> spouts = topology.get_spouts();
Map<String, Bolt> bolts = topology.get_bolts();
Map<String, StateSpoutSpec> state_spouts = topology.get_state_spouts();
Compo... | java | public static Object get_task_object(StormTopology topology, String component_id, URLClassLoader loader) {
Map<String, SpoutSpec> spouts = topology.get_spouts();
Map<String, Bolt> bolts = topology.get_bolts();
Map<String, StateSpoutSpec> state_spouts = topology.get_state_spouts();
Compo... | [
"public",
"static",
"Object",
"get_task_object",
"(",
"StormTopology",
"topology",
",",
"String",
"component_id",
",",
"URLClassLoader",
"loader",
")",
"{",
"Map",
"<",
"String",
",",
"SpoutSpec",
">",
"spouts",
"=",
"topology",
".",
"get_spouts",
"(",
")",
";... | get object of component_id | [
"get",
"object",
"of",
"component_id"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L649-L683 |
25,198 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java | Common.getComponentMap | public static Map getComponentMap(DefaultTopologyAssignContext context, Integer task) {
String componentName = context.getTaskToComponent().get(task);
ComponentCommon componentCommon = ThriftTopologyUtils.getComponentCommon(context.getSysTopology(), componentName);
Map componentMap = (Map) JSto... | java | public static Map getComponentMap(DefaultTopologyAssignContext context, Integer task) {
String componentName = context.getTaskToComponent().get(task);
ComponentCommon componentCommon = ThriftTopologyUtils.getComponentCommon(context.getSysTopology(), componentName);
Map componentMap = (Map) JSto... | [
"public",
"static",
"Map",
"getComponentMap",
"(",
"DefaultTopologyAssignContext",
"context",
",",
"Integer",
"task",
")",
"{",
"String",
"componentName",
"=",
"context",
".",
"getTaskToComponent",
"(",
")",
".",
"get",
"(",
"task",
")",
";",
"ComponentCommon",
... | get the component's configuration | [
"get",
"the",
"component",
"s",
"configuration"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/Common.java#L726-L735 |
25,199 | alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/cluster/DistributedClusterState.java | DistributedClusterState.get_version | @Override
public Integer get_version(String path, boolean watch) throws Exception {
return zkObj.getVersion(zk, path, watch);
} | java | @Override
public Integer get_version(String path, boolean watch) throws Exception {
return zkObj.getVersion(zk, path, watch);
} | [
"@",
"Override",
"public",
"Integer",
"get_version",
"(",
"String",
"path",
",",
"boolean",
"watch",
")",
"throws",
"Exception",
"{",
"return",
"zkObj",
".",
"getVersion",
"(",
"zk",
",",
"path",
",",
"watch",
")",
";",
"}"
] | Note that get_version doesn't use zkCache avoid to conflict with get_data | [
"Note",
"that",
"get_version",
"doesn",
"t",
"use",
"zkCache",
"avoid",
"to",
"conflict",
"with",
"get_data"
] | 5d6cde22dbca7df3d6e6830bf94f98a6639ab559 | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/cluster/DistributedClusterState.java#L149-L152 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.