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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
19,000 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getLocalHostName | public static synchronized String getLocalHostName(int timeoutMs) {
if (sLocalHost != null) {
return sLocalHost;
}
try {
sLocalHost = InetAddress.getByName(getLocalIpAddress(timeoutMs)).getCanonicalHostName();
return sLocalHost;
} catch (UnknownHostException e) {
throw new Runti... | java | public static synchronized String getLocalHostName(int timeoutMs) {
if (sLocalHost != null) {
return sLocalHost;
}
try {
sLocalHost = InetAddress.getByName(getLocalIpAddress(timeoutMs)).getCanonicalHostName();
return sLocalHost;
} catch (UnknownHostException e) {
throw new Runti... | [
"public",
"static",
"synchronized",
"String",
"getLocalHostName",
"(",
"int",
"timeoutMs",
")",
"{",
"if",
"(",
"sLocalHost",
"!=",
"null",
")",
"{",
"return",
"sLocalHost",
";",
"}",
"try",
"{",
"sLocalHost",
"=",
"InetAddress",
".",
"getByName",
"(",
"getL... | Gets a local host name for the host this JVM is running on.
@param timeoutMs Timeout in milliseconds to use for checking that a possible local host is
reachable
@return the local host name, which is not based on a loopback ip address | [
"Gets",
"a",
"local",
"host",
"name",
"for",
"the",
"host",
"this",
"JVM",
"is",
"running",
"on",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L410-L421 |
19,001 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getLocalHostMetricName | public static synchronized String getLocalHostMetricName(int timeoutMs) {
if (sLocalHostMetricName != null) {
return sLocalHostMetricName;
}
sLocalHostMetricName = getLocalHostName(timeoutMs).replace('.', '_');
return sLocalHostMetricName;
} | java | public static synchronized String getLocalHostMetricName(int timeoutMs) {
if (sLocalHostMetricName != null) {
return sLocalHostMetricName;
}
sLocalHostMetricName = getLocalHostName(timeoutMs).replace('.', '_');
return sLocalHostMetricName;
} | [
"public",
"static",
"synchronized",
"String",
"getLocalHostMetricName",
"(",
"int",
"timeoutMs",
")",
"{",
"if",
"(",
"sLocalHostMetricName",
"!=",
"null",
")",
"{",
"return",
"sLocalHostMetricName",
";",
"}",
"sLocalHostMetricName",
"=",
"getLocalHostName",
"(",
"t... | Gets a local hostname for the host this JVM is running on with '.' replaced with '_' for
metrics usage.
@param timeoutMs Timeout in milliseconds to use for checking that a possible local host is
reachable
@return the metrics system friendly local host name | [
"Gets",
"a",
"local",
"hostname",
"for",
"the",
"host",
"this",
"JVM",
"is",
"running",
"on",
"with",
".",
"replaced",
"with",
"_",
"for",
"metrics",
"usage",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L431-L437 |
19,002 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getLocalIpAddress | public static synchronized String getLocalIpAddress(int timeoutMs) {
if (sLocalIP != null) {
return sLocalIP;
}
try {
InetAddress address = InetAddress.getLocalHost();
LOG.debug("address: {} isLoopbackAddress: {}, with host {} {}", address,
address.isLoopbackAddress(), address.g... | java | public static synchronized String getLocalIpAddress(int timeoutMs) {
if (sLocalIP != null) {
return sLocalIP;
}
try {
InetAddress address = InetAddress.getLocalHost();
LOG.debug("address: {} isLoopbackAddress: {}, with host {} {}", address,
address.isLoopbackAddress(), address.g... | [
"public",
"static",
"synchronized",
"String",
"getLocalIpAddress",
"(",
"int",
"timeoutMs",
")",
"{",
"if",
"(",
"sLocalIP",
"!=",
"null",
")",
"{",
"return",
"sLocalIP",
";",
"}",
"try",
"{",
"InetAddress",
"address",
"=",
"InetAddress",
".",
"getLocalHost",
... | Gets a local IP address for the host this JVM is running on.
@param timeoutMs Timeout in milliseconds to use for checking that a possible local IP is
reachable
@return the local ip address, which is not a loopback address and is reachable | [
"Gets",
"a",
"local",
"IP",
"address",
"for",
"the",
"host",
"this",
"JVM",
"is",
"running",
"on",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L446-L496 |
19,003 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.isValidAddress | private static boolean isValidAddress(InetAddress address, int timeoutMs) throws IOException {
return !address.isAnyLocalAddress() && !address.isLinkLocalAddress()
&& !address.isLoopbackAddress() && address.isReachable(timeoutMs)
&& (address instanceof Inet4Address);
} | java | private static boolean isValidAddress(InetAddress address, int timeoutMs) throws IOException {
return !address.isAnyLocalAddress() && !address.isLinkLocalAddress()
&& !address.isLoopbackAddress() && address.isReachable(timeoutMs)
&& (address instanceof Inet4Address);
} | [
"private",
"static",
"boolean",
"isValidAddress",
"(",
"InetAddress",
"address",
",",
"int",
"timeoutMs",
")",
"throws",
"IOException",
"{",
"return",
"!",
"address",
".",
"isAnyLocalAddress",
"(",
")",
"&&",
"!",
"address",
".",
"isLinkLocalAddress",
"(",
")",
... | Tests if the address is externally resolvable. Address must not be wildcard, link local,
loopback address, non-IPv4, or other unreachable addresses.
@param address The testing address
@param timeoutMs Timeout in milliseconds to use for checking that a possible local IP is
reachable
@return a {@code boolean} indicating... | [
"Tests",
"if",
"the",
"address",
"is",
"externally",
"resolvable",
".",
"Address",
"must",
"not",
"be",
"wildcard",
"link",
"local",
"loopback",
"address",
"non",
"-",
"IPv4",
"or",
"other",
"unreachable",
"addresses",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L525-L529 |
19,004 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.resolveIpAddress | public static String resolveIpAddress(String hostname) throws UnknownHostException {
Preconditions.checkNotNull(hostname, "hostname");
Preconditions.checkArgument(!hostname.isEmpty(),
"Cannot resolve IP address for empty hostname");
return InetAddress.getByName(hostname).getHostAddress();
} | java | public static String resolveIpAddress(String hostname) throws UnknownHostException {
Preconditions.checkNotNull(hostname, "hostname");
Preconditions.checkArgument(!hostname.isEmpty(),
"Cannot resolve IP address for empty hostname");
return InetAddress.getByName(hostname).getHostAddress();
} | [
"public",
"static",
"String",
"resolveIpAddress",
"(",
"String",
"hostname",
")",
"throws",
"UnknownHostException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"hostname",
",",
"\"hostname\"",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"!",
"hostname"... | Resolves a given hostname IP address.
@param hostname the input hostname, which could be an alias
@return the hostname IP address
@throws UnknownHostException if the given hostname cannot be resolved | [
"Resolves",
"a",
"given",
"hostname",
"IP",
"address",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L556-L561 |
19,005 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getRpcPortSocketAddress | public static InetSocketAddress getRpcPortSocketAddress(WorkerNetAddress netAddress) {
String host = netAddress.getHost();
int port = netAddress.getRpcPort();
return new InetSocketAddress(host, port);
} | java | public static InetSocketAddress getRpcPortSocketAddress(WorkerNetAddress netAddress) {
String host = netAddress.getHost();
int port = netAddress.getRpcPort();
return new InetSocketAddress(host, port);
} | [
"public",
"static",
"InetSocketAddress",
"getRpcPortSocketAddress",
"(",
"WorkerNetAddress",
"netAddress",
")",
"{",
"String",
"host",
"=",
"netAddress",
".",
"getHost",
"(",
")",
";",
"int",
"port",
"=",
"netAddress",
".",
"getRpcPort",
"(",
")",
";",
"return",... | Extracts rpcPort InetSocketAddress from Alluxio representation of network address.
@param netAddress the input network address representation
@return InetSocketAddress | [
"Extracts",
"rpcPort",
"InetSocketAddress",
"from",
"Alluxio",
"representation",
"of",
"network",
"address",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L611-L615 |
19,006 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.getDataPortSocketAddress | public static SocketAddress getDataPortSocketAddress(WorkerNetAddress netAddress,
AlluxioConfiguration conf) {
SocketAddress address;
if (NettyUtils.isDomainSocketSupported(netAddress, conf)) {
address = new DomainSocketAddress(netAddress.getDomainSocketPath());
} else {
String host = netA... | java | public static SocketAddress getDataPortSocketAddress(WorkerNetAddress netAddress,
AlluxioConfiguration conf) {
SocketAddress address;
if (NettyUtils.isDomainSocketSupported(netAddress, conf)) {
address = new DomainSocketAddress(netAddress.getDomainSocketPath());
} else {
String host = netA... | [
"public",
"static",
"SocketAddress",
"getDataPortSocketAddress",
"(",
"WorkerNetAddress",
"netAddress",
",",
"AlluxioConfiguration",
"conf",
")",
"{",
"SocketAddress",
"address",
";",
"if",
"(",
"NettyUtils",
".",
"isDomainSocketSupported",
"(",
"netAddress",
",",
"conf... | Extracts dataPort socket address from Alluxio representation of network address.
@param netAddress the input network address representation
@param conf Alluxio configuration
@return the socket address | [
"Extracts",
"dataPort",
"socket",
"address",
"from",
"Alluxio",
"representation",
"of",
"network",
"address",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L624-L635 |
19,007 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java | NetworkAddressUtils.pingService | public static void pingService(InetSocketAddress address, alluxio.grpc.ServiceType serviceType,
AlluxioConfiguration conf)
throws AlluxioStatusException {
Preconditions.checkNotNull(address, "address");
Preconditions.checkNotNull(serviceType, "serviceType");
GrpcChannel channel =
GrpcCha... | java | public static void pingService(InetSocketAddress address, alluxio.grpc.ServiceType serviceType,
AlluxioConfiguration conf)
throws AlluxioStatusException {
Preconditions.checkNotNull(address, "address");
Preconditions.checkNotNull(serviceType, "serviceType");
GrpcChannel channel =
GrpcCha... | [
"public",
"static",
"void",
"pingService",
"(",
"InetSocketAddress",
"address",
",",
"alluxio",
".",
"grpc",
".",
"ServiceType",
"serviceType",
",",
"AlluxioConfiguration",
"conf",
")",
"throws",
"AlluxioStatusException",
"{",
"Preconditions",
".",
"checkNotNull",
"("... | Test if the input address is serving an Alluxio service. This method make use of the
gRPC protocol for performing service communication.
@param address the network address to ping
@param serviceType the Alluxio service type
@param conf Alluxio configuration
@throws UnauthenticatedException If the user is not authentic... | [
"Test",
"if",
"the",
"input",
"address",
"is",
"serving",
"an",
"Alluxio",
"service",
".",
"This",
"method",
"make",
"use",
"of",
"the",
"gRPC",
"protocol",
"for",
"performing",
"service",
"communication",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/network/NetworkAddressUtils.java#L647-L659 |
19,008 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java | ServerConfigurationChecker.regenerateReport | public synchronized void regenerateReport() {
// Generate the configuration map from master and worker configuration records
Map<PropertyKey, Map<Optional<String>, List<String>>> confMap = generateConfMap();
// Update the errors and warnings configuration
Map<Scope, List<InconsistentProperty>> confErro... | java | public synchronized void regenerateReport() {
// Generate the configuration map from master and worker configuration records
Map<PropertyKey, Map<Optional<String>, List<String>>> confMap = generateConfMap();
// Update the errors and warnings configuration
Map<Scope, List<InconsistentProperty>> confErro... | [
"public",
"synchronized",
"void",
"regenerateReport",
"(",
")",
"{",
"// Generate the configuration map from master and worker configuration records",
"Map",
"<",
"PropertyKey",
",",
"Map",
"<",
"Optional",
"<",
"String",
">",
",",
"List",
"<",
"String",
">",
">",
">"... | Checks the server-side configurations and records the check results. | [
"Checks",
"the",
"server",
"-",
"side",
"configurations",
"and",
"records",
"the",
"check",
"results",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java#L72-L106 |
19,009 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java | ServerConfigurationChecker.logConfigReport | public synchronized void logConfigReport() {
ConfigStatus reportStatus = mConfigCheckReport.getConfigStatus();
if (reportStatus.equals(ConfigStatus.PASSED)) {
LOG.info(CONSISTENT_CONFIGURATION_INFO);
} else if (reportStatus.equals(ConfigStatus.WARN)) {
LOG.warn("{}\nWarnings: {}", INCONSISTENT_C... | java | public synchronized void logConfigReport() {
ConfigStatus reportStatus = mConfigCheckReport.getConfigStatus();
if (reportStatus.equals(ConfigStatus.PASSED)) {
LOG.info(CONSISTENT_CONFIGURATION_INFO);
} else if (reportStatus.equals(ConfigStatus.WARN)) {
LOG.warn("{}\nWarnings: {}", INCONSISTENT_C... | [
"public",
"synchronized",
"void",
"logConfigReport",
"(",
")",
"{",
"ConfigStatus",
"reportStatus",
"=",
"mConfigCheckReport",
".",
"getConfigStatus",
"(",
")",
";",
"if",
"(",
"reportStatus",
".",
"equals",
"(",
"ConfigStatus",
".",
"PASSED",
")",
")",
"{",
"... | Logs the configuration check report information. | [
"Logs",
"the",
"configuration",
"check",
"report",
"information",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java#L128-L143 |
19,010 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java | ServerConfigurationChecker.fillConfMap | private void fillConfMap(Map<PropertyKey, Map<Optional<String>, List<String>>> targetMap,
Map<Address, List<ConfigRecord>> recordMap) {
for (Map.Entry<Address, List<ConfigRecord>> record : recordMap.entrySet()) {
Address address = record.getKey();
String addressStr = String.format("%s:%s", address... | java | private void fillConfMap(Map<PropertyKey, Map<Optional<String>, List<String>>> targetMap,
Map<Address, List<ConfigRecord>> recordMap) {
for (Map.Entry<Address, List<ConfigRecord>> record : recordMap.entrySet()) {
Address address = record.getKey();
String addressStr = String.format("%s:%s", address... | [
"private",
"void",
"fillConfMap",
"(",
"Map",
"<",
"PropertyKey",
",",
"Map",
"<",
"Optional",
"<",
"String",
">",
",",
"List",
"<",
"String",
">",
">",
">",
"targetMap",
",",
"Map",
"<",
"Address",
",",
"List",
"<",
"ConfigRecord",
">",
">",
"recordMa... | Fills the configuration map.
@param targetMap the map to fill
@param recordMap the map to get data from | [
"Fills",
"the",
"configuration",
"map",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/checkconf/ServerConfigurationChecker.java#L164-L181 |
19,011 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/file/FileInStream.java | FileInStream.updateStream | private void updateStream() throws IOException {
if (mBlockInStream != null && mBlockInStream.remaining() > 0) { // can still read from stream
return;
}
if (mBlockInStream != null && mBlockInStream.remaining() == 0) { // current stream is done
closeBlockInStream(mBlockInStream);
}
/* C... | java | private void updateStream() throws IOException {
if (mBlockInStream != null && mBlockInStream.remaining() > 0) { // can still read from stream
return;
}
if (mBlockInStream != null && mBlockInStream.remaining() == 0) { // current stream is done
closeBlockInStream(mBlockInStream);
}
/* C... | [
"private",
"void",
"updateStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mBlockInStream",
"!=",
"null",
"&&",
"mBlockInStream",
".",
"remaining",
"(",
")",
">",
"0",
")",
"{",
"// can still read from stream",
"return",
";",
"}",
"if",
"(",
"mBl... | Initializes the underlying block stream if necessary. This method must be called before
reading from mBlockInStream. | [
"Initializes",
"the",
"underlying",
"block",
"stream",
"if",
"necessary",
".",
"This",
"method",
"must",
"be",
"called",
"before",
"reading",
"from",
"mBlockInStream",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileInStream.java#L298-L315 |
19,012 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/file/FileInStream.java | FileInStream.triggerAsyncCaching | private void triggerAsyncCaching(BlockInStream stream) throws IOException {
boolean cache = ReadType.fromProto(mOptions.getOptions().getReadType()).isCache();
boolean overReplicated = mStatus.getReplicationMax() > 0
&& mStatus.getFileBlockInfos().get((int) (getPos() / mBlockSize))
.getBlockInfo(... | java | private void triggerAsyncCaching(BlockInStream stream) throws IOException {
boolean cache = ReadType.fromProto(mOptions.getOptions().getReadType()).isCache();
boolean overReplicated = mStatus.getReplicationMax() > 0
&& mStatus.getFileBlockInfos().get((int) (getPos() / mBlockSize))
.getBlockInfo(... | [
"private",
"void",
"triggerAsyncCaching",
"(",
"BlockInStream",
"stream",
")",
"throws",
"IOException",
"{",
"boolean",
"cache",
"=",
"ReadType",
".",
"fromProto",
"(",
"mOptions",
".",
"getOptions",
"(",
")",
".",
"getReadType",
"(",
")",
")",
".",
"isCache",... | Send an async cache request to a worker based on read type and passive cache options. | [
"Send",
"an",
"async",
"cache",
"request",
"to",
"a",
"worker",
"based",
"on",
"read",
"type",
"and",
"passive",
"cache",
"options",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileInStream.java#L333-L369 |
19,013 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/DailyMetadataBackup.java | DailyMetadataBackup.getTimeToNextBackup | private long getTimeToNextBackup() {
LocalDateTime now = LocalDateTime.now(Clock.systemUTC());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("H:mm");
LocalTime backupTime = LocalTime.parse(ServerConfiguration
.get(PropertyKey.MASTER_DAILY_BACKUP_TIME), formatter);
LocalDateTime next... | java | private long getTimeToNextBackup() {
LocalDateTime now = LocalDateTime.now(Clock.systemUTC());
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("H:mm");
LocalTime backupTime = LocalTime.parse(ServerConfiguration
.get(PropertyKey.MASTER_DAILY_BACKUP_TIME), formatter);
LocalDateTime next... | [
"private",
"long",
"getTimeToNextBackup",
"(",
")",
"{",
"LocalDateTime",
"now",
"=",
"LocalDateTime",
".",
"now",
"(",
"Clock",
".",
"systemUTC",
"(",
")",
")",
";",
"DateTimeFormatter",
"formatter",
"=",
"DateTimeFormatter",
".",
"ofPattern",
"(",
"\"H:mm\"",
... | Gets the time gap between now and next backup time.
@return the time gap to next backup | [
"Gets",
"the",
"time",
"gap",
"between",
"now",
"and",
"next",
"backup",
"time",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/DailyMetadataBackup.java#L92-L104 |
19,014 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/DailyMetadataBackup.java | DailyMetadataBackup.dailyBackup | private void dailyBackup() {
try {
BackupResponse resp = mMetaMaster.backup(BackupPOptions.newBuilder()
.setTargetDirectory(mBackupDir).setLocalFileSystem(mIsLocal).build());
if (mIsLocal) {
LOG.info("Successfully backed up journal to {} on master {}",
resp.getBackupUri(), ... | java | private void dailyBackup() {
try {
BackupResponse resp = mMetaMaster.backup(BackupPOptions.newBuilder()
.setTargetDirectory(mBackupDir).setLocalFileSystem(mIsLocal).build());
if (mIsLocal) {
LOG.info("Successfully backed up journal to {} on master {}",
resp.getBackupUri(), ... | [
"private",
"void",
"dailyBackup",
"(",
")",
"{",
"try",
"{",
"BackupResponse",
"resp",
"=",
"mMetaMaster",
".",
"backup",
"(",
"BackupPOptions",
".",
"newBuilder",
"(",
")",
".",
"setTargetDirectory",
"(",
"mBackupDir",
")",
".",
"setLocalFileSystem",
"(",
"mI... | The daily backup task. | [
"The",
"daily",
"backup",
"task",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/DailyMetadataBackup.java#L109-L129 |
19,015 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/DailyMetadataBackup.java | DailyMetadataBackup.deleteStaleBackups | private void deleteStaleBackups() throws Exception {
UfsStatus[] statuses = mUfs.listStatus(mBackupDir);
if (statuses.length <= mRetainedFiles) {
return;
}
// Sort the backup files according to create time from oldest to newest
TreeMap<Instant, String> timeToFile = new TreeMap<>((a, b) -> (
... | java | private void deleteStaleBackups() throws Exception {
UfsStatus[] statuses = mUfs.listStatus(mBackupDir);
if (statuses.length <= mRetainedFiles) {
return;
}
// Sort the backup files according to create time from oldest to newest
TreeMap<Instant, String> timeToFile = new TreeMap<>((a, b) -> (
... | [
"private",
"void",
"deleteStaleBackups",
"(",
")",
"throws",
"Exception",
"{",
"UfsStatus",
"[",
"]",
"statuses",
"=",
"mUfs",
".",
"listStatus",
"(",
"mBackupDir",
")",
";",
"if",
"(",
"statuses",
".",
"length",
"<=",
"mRetainedFiles",
")",
"{",
"return",
... | Deletes stale backup files to avoid consuming too many spaces. | [
"Deletes",
"stale",
"backup",
"files",
"to",
"avoid",
"consuming",
"too",
"many",
"spaces",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/DailyMetadataBackup.java#L134-L163 |
19,016 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/AsyncCacheRequestManager.java | AsyncCacheRequestManager.submitRequest | public void submitRequest(AsyncCacheRequest request) {
ASYNC_CACHE_REQUESTS.inc();
long blockId = request.getBlockId();
long blockLength = request.getLength();
if (mPendingRequests.putIfAbsent(blockId, request) != null) {
// This block is already planned.
ASYNC_CACHE_DUPLICATE_REQUESTS.inc()... | java | public void submitRequest(AsyncCacheRequest request) {
ASYNC_CACHE_REQUESTS.inc();
long blockId = request.getBlockId();
long blockLength = request.getLength();
if (mPendingRequests.putIfAbsent(blockId, request) != null) {
// This block is already planned.
ASYNC_CACHE_DUPLICATE_REQUESTS.inc()... | [
"public",
"void",
"submitRequest",
"(",
"AsyncCacheRequest",
"request",
")",
"{",
"ASYNC_CACHE_REQUESTS",
".",
"inc",
"(",
")",
";",
"long",
"blockId",
"=",
"request",
".",
"getBlockId",
"(",
")",
";",
"long",
"blockLength",
"=",
"request",
".",
"getLength",
... | Handles a request to cache a block asynchronously. This is a non-blocking call.
@param request the async cache request fields will be available | [
"Handles",
"a",
"request",
"to",
"cache",
"a",
"block",
"asynchronously",
".",
"This",
"is",
"a",
"non",
"-",
"blocking",
"call",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/AsyncCacheRequestManager.java#L81-L138 |
19,017 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/AsyncCacheRequestManager.java | AsyncCacheRequestManager.cacheBlockFromUfs | private boolean cacheBlockFromUfs(long blockId, long blockSize,
Protocol.OpenUfsBlockOptions openUfsBlockOptions) {
// Check if the block has been requested in UFS block store
try {
if (!mBlockWorker
.openUfsBlock(Sessions.ASYNC_CACHE_SESSION_ID, blockId, openUfsBlockOptions)) {
LO... | java | private boolean cacheBlockFromUfs(long blockId, long blockSize,
Protocol.OpenUfsBlockOptions openUfsBlockOptions) {
// Check if the block has been requested in UFS block store
try {
if (!mBlockWorker
.openUfsBlock(Sessions.ASYNC_CACHE_SESSION_ID, blockId, openUfsBlockOptions)) {
LO... | [
"private",
"boolean",
"cacheBlockFromUfs",
"(",
"long",
"blockId",
",",
"long",
"blockSize",
",",
"Protocol",
".",
"OpenUfsBlockOptions",
"openUfsBlockOptions",
")",
"{",
"// Check if the block has been requested in UFS block store",
"try",
"{",
"if",
"(",
"!",
"mBlockWor... | Caches the block via the local worker to read from UFS.
@param blockId block ID
@param blockSize block size
@param openUfsBlockOptions options to open the UFS file
@return if the block is cached | [
"Caches",
"the",
"block",
"via",
"the",
"local",
"worker",
"to",
"read",
"from",
"UFS",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/AsyncCacheRequestManager.java#L148-L185 |
19,018 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/AsyncJournalWriter.java | AsyncJournalWriter.flush | public void flush(final long targetCounter) throws IOException, JournalClosedException {
// Return if flushed.
if (targetCounter <= mFlushCounter.get()) {
return;
}
// Submit the ticket for flush thread to process.
FlushTicket ticket = new FlushTicket(targetCounter);
try (LockResource lr ... | java | public void flush(final long targetCounter) throws IOException, JournalClosedException {
// Return if flushed.
if (targetCounter <= mFlushCounter.get()) {
return;
}
// Submit the ticket for flush thread to process.
FlushTicket ticket = new FlushTicket(targetCounter);
try (LockResource lr ... | [
"public",
"void",
"flush",
"(",
"final",
"long",
"targetCounter",
")",
"throws",
"IOException",
",",
"JournalClosedException",
"{",
"// Return if flushed.",
"if",
"(",
"targetCounter",
"<=",
"mFlushCounter",
".",
"get",
"(",
")",
")",
"{",
"return",
";",
"}",
... | Submits a ticket to flush thread and waits until ticket is served.
If the specified counter is already flushed, this is essentially a no-op.
@param targetCounter the counter to flush | [
"Submits",
"a",
"ticket",
"to",
"flush",
"thread",
"and",
"waits",
"until",
"ticket",
"is",
"served",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/AsyncJournalWriter.java#L327-L365 |
19,019 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/MutableInodeFile.java | MutableInodeFile.updateFromEntry | public void updateFromEntry(UpdateInodeFileEntry entry) {
if (entry.hasPersistJobId()) {
setPersistJobId(entry.getPersistJobId());
}
if (entry.hasReplicationMax()) {
setReplicationMax(entry.getReplicationMax());
}
if (entry.hasReplicationMin()) {
setReplicationMin(entry.getReplicat... | java | public void updateFromEntry(UpdateInodeFileEntry entry) {
if (entry.hasPersistJobId()) {
setPersistJobId(entry.getPersistJobId());
}
if (entry.hasReplicationMax()) {
setReplicationMax(entry.getReplicationMax());
}
if (entry.hasReplicationMin()) {
setReplicationMin(entry.getReplicat... | [
"public",
"void",
"updateFromEntry",
"(",
"UpdateInodeFileEntry",
"entry",
")",
"{",
"if",
"(",
"entry",
".",
"hasPersistJobId",
"(",
")",
")",
"{",
"setPersistJobId",
"(",
"entry",
".",
"getPersistJobId",
"(",
")",
")",
";",
"}",
"if",
"(",
"entry",
".",
... | Updates this inode file's state from the given entry.
@param entry the entry | [
"Updates",
"this",
"inode",
"file",
"s",
"state",
"from",
"the",
"given",
"entry",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/MutableInodeFile.java#L305-L333 |
19,020 | Alluxio/alluxio | job/common/src/main/java/alluxio/job/util/SerializationUtils.java | SerializationUtils.serialize | public static byte[] serialize(Object obj) throws IOException {
if (obj == null) {
return null;
}
try (ByteArrayOutputStream b = new ByteArrayOutputStream()) {
try (ObjectOutputStream o = new ObjectOutputStream(b)) {
o.writeObject(obj);
}
return b.toByteArray();
}
} | java | public static byte[] serialize(Object obj) throws IOException {
if (obj == null) {
return null;
}
try (ByteArrayOutputStream b = new ByteArrayOutputStream()) {
try (ObjectOutputStream o = new ObjectOutputStream(b)) {
o.writeObject(obj);
}
return b.toByteArray();
}
} | [
"public",
"static",
"byte",
"[",
"]",
"serialize",
"(",
"Object",
"obj",
")",
"throws",
"IOException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"(",
"ByteArrayOutputStream",
"b",
"=",
"new",
"ByteArrayOutputStream",... | Serializes an object into a byte array. When the object is null, returns null.
@param obj the object to serialize
@return the serialized bytes
@throws IOException if the serialization fails | [
"Serializes",
"an",
"object",
"into",
"a",
"byte",
"array",
".",
"When",
"the",
"object",
"is",
"null",
"returns",
"null",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/util/SerializationUtils.java#L43-L53 |
19,021 | Alluxio/alluxio | job/common/src/main/java/alluxio/job/util/SerializationUtils.java | SerializationUtils.deserialize | public static Serializable deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
if (bytes == null) {
return null;
}
try (ByteArrayInputStream b = new ByteArrayInputStream(bytes)) {
try (ObjectInputStream o = new ObjectInputStream(b)) {
return (Serializable) o.readObject... | java | public static Serializable deserialize(byte[] bytes) throws IOException, ClassNotFoundException {
if (bytes == null) {
return null;
}
try (ByteArrayInputStream b = new ByteArrayInputStream(bytes)) {
try (ObjectInputStream o = new ObjectInputStream(b)) {
return (Serializable) o.readObject... | [
"public",
"static",
"Serializable",
"deserialize",
"(",
"byte",
"[",
"]",
"bytes",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"if",
"(",
"bytes",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"(",
"ByteArrayInputStream",
"... | Deserializes a byte array into an object. When the bytes are null, returns null.
@param bytes the byte array to deserialize
@return the deserialized object
@throws IOException if the deserialization fails
@throws ClassNotFoundException if no class found to deserialize into | [
"Deserializes",
"a",
"byte",
"array",
"into",
"an",
"object",
".",
"When",
"the",
"bytes",
"are",
"null",
"returns",
"null",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/common/src/main/java/alluxio/job/util/SerializationUtils.java#L79-L88 |
19,022 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/evictor/LRFUEvictor.java | LRFUEvictor.getSortedCRF | private List<Map.Entry<Long, Double>> getSortedCRF() {
List<Map.Entry<Long, Double>> sortedCRF = new ArrayList<>(mBlockIdToCRFValue.entrySet());
sortedCRF.sort(Comparator.comparingDouble(Entry::getValue));
return sortedCRF;
} | java | private List<Map.Entry<Long, Double>> getSortedCRF() {
List<Map.Entry<Long, Double>> sortedCRF = new ArrayList<>(mBlockIdToCRFValue.entrySet());
sortedCRF.sort(Comparator.comparingDouble(Entry::getValue));
return sortedCRF;
} | [
"private",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Long",
",",
"Double",
">",
">",
"getSortedCRF",
"(",
")",
"{",
"List",
"<",
"Map",
".",
"Entry",
"<",
"Long",
",",
"Double",
">",
">",
"sortedCRF",
"=",
"new",
"ArrayList",
"<>",
"(",
"mBlockIdToCRFV... | Sorts all blocks in ascending order of CRF.
@return the sorted CRF of all blocks | [
"Sorts",
"all",
"blocks",
"in",
"ascending",
"order",
"of",
"CRF",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/evictor/LRFUEvictor.java#L134-L138 |
19,023 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/ExtensionUtils.java | ExtensionUtils.listExtensions | public static File[] listExtensions(String extensionDir) {
File[] extensions = new File(extensionDir)
.listFiles(file -> file.getPath().toLowerCase().endsWith(Constants.EXTENSION_JAR));
if (extensions == null) {
// Directory does not exist
return EMPTY_EXTENSIONS_LIST;
}
return exten... | java | public static File[] listExtensions(String extensionDir) {
File[] extensions = new File(extensionDir)
.listFiles(file -> file.getPath().toLowerCase().endsWith(Constants.EXTENSION_JAR));
if (extensions == null) {
// Directory does not exist
return EMPTY_EXTENSIONS_LIST;
}
return exten... | [
"public",
"static",
"File",
"[",
"]",
"listExtensions",
"(",
"String",
"extensionDir",
")",
"{",
"File",
"[",
"]",
"extensions",
"=",
"new",
"File",
"(",
"extensionDir",
")",
".",
"listFiles",
"(",
"file",
"->",
"file",
".",
"getPath",
"(",
")",
".",
"... | List extension jars from the configured extensions directory.
@param extensionDir the directory containing extensions
@return an array of files (one file per jar) | [
"List",
"extension",
"jars",
"from",
"the",
"configured",
"extensions",
"directory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/ExtensionUtils.java#L34-L42 |
19,024 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockStoreLocation.java | BlockStoreLocation.belongsTo | public boolean belongsTo(BlockStoreLocation location) {
boolean tierInRange =
tierAlias().equals(location.tierAlias()) || location.tierAlias().equals(ANY_TIER);
boolean dirInRange = (dir() == location.dir()) || (location.dir() == ANY_DIR);
return tierInRange && dirInRange;
} | java | public boolean belongsTo(BlockStoreLocation location) {
boolean tierInRange =
tierAlias().equals(location.tierAlias()) || location.tierAlias().equals(ANY_TIER);
boolean dirInRange = (dir() == location.dir()) || (location.dir() == ANY_DIR);
return tierInRange && dirInRange;
} | [
"public",
"boolean",
"belongsTo",
"(",
"BlockStoreLocation",
"location",
")",
"{",
"boolean",
"tierInRange",
"=",
"tierAlias",
"(",
")",
".",
"equals",
"(",
"location",
".",
"tierAlias",
"(",
")",
")",
"||",
"location",
".",
"tierAlias",
"(",
")",
".",
"eq... | Returns whether this location belongs to the specific location.
Location A belongs to B when tier and dir of A are all in the range of B respectively.
@param location the target BlockStoreLocation
@return true when this BlockStoreLocation belongs to the target, otherwise false | [
"Returns",
"whether",
"this",
"location",
"belongs",
"to",
"the",
"specific",
"location",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockStoreLocation.java#L93-L98 |
19,025 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/web/WebServer.java | WebServer.stop | public void stop() throws Exception {
// close all connectors and release all binding ports
for (Connector connector : mServer.getConnectors()) {
connector.stop();
}
mServer.stop();
} | java | public void stop() throws Exception {
// close all connectors and release all binding ports
for (Connector connector : mServer.getConnectors()) {
connector.stop();
}
mServer.stop();
} | [
"public",
"void",
"stop",
"(",
")",
"throws",
"Exception",
"{",
"// close all connectors and release all binding ports",
"for",
"(",
"Connector",
"connector",
":",
"mServer",
".",
"getConnectors",
"(",
")",
")",
"{",
"connector",
".",
"stop",
"(",
")",
";",
"}",... | Shuts down the web server. | [
"Shuts",
"down",
"the",
"web",
"server",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/web/WebServer.java#L145-L152 |
19,026 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/web/WebServer.java | WebServer.start | public void start() {
try {
mServer.start();
LOG.info("{} started @ {}", mServiceName, mAddress);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public void start() {
try {
mServer.start();
LOG.info("{} started @ {}", mServiceName, mAddress);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"void",
"start",
"(",
")",
"{",
"try",
"{",
"mServer",
".",
"start",
"(",
")",
";",
"LOG",
".",
"info",
"(",
"\"{} started @ {}\"",
",",
"mServiceName",
",",
"mAddress",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new... | Starts the web server. | [
"Starts",
"the",
"web",
"server",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/web/WebServer.java#L157-L164 |
19,027 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/TLRandom.java | TLRandom.eraseThreadLocals | static final void eraseThreadLocals(Thread thread) {
U.putObject(thread, THREADLOCALS, null);
U.putObject(thread, INHERITABLETHREADLOCALS, null);
} | java | static final void eraseThreadLocals(Thread thread) {
U.putObject(thread, THREADLOCALS, null);
U.putObject(thread, INHERITABLETHREADLOCALS, null);
} | [
"static",
"final",
"void",
"eraseThreadLocals",
"(",
"Thread",
"thread",
")",
"{",
"U",
".",
"putObject",
"(",
"thread",
",",
"THREADLOCALS",
",",
"null",
")",
";",
"U",
".",
"putObject",
"(",
"thread",
",",
"INHERITABLETHREADLOCALS",
",",
"null",
")",
";"... | Erases ThreadLocals by nulling out Thread maps. | [
"Erases",
"ThreadLocals",
"by",
"nulling",
"out",
"Thread",
"maps",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/TLRandom.java#L181-L184 |
19,028 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java | UfsJournalCheckpointThread.awaitTermination | public void awaitTermination(boolean waitQuietPeriod) {
LOG.info("{}: Journal checkpointer shutdown has been initiated.", mMaster.getName());
mWaitQuietPeriod = waitQuietPeriod;
mShutdownInitiated = true;
// Actively interrupt to cancel slow checkpoints.
synchronized (mCheckpointingLock) {
if ... | java | public void awaitTermination(boolean waitQuietPeriod) {
LOG.info("{}: Journal checkpointer shutdown has been initiated.", mMaster.getName());
mWaitQuietPeriod = waitQuietPeriod;
mShutdownInitiated = true;
// Actively interrupt to cancel slow checkpoints.
synchronized (mCheckpointingLock) {
if ... | [
"public",
"void",
"awaitTermination",
"(",
"boolean",
"waitQuietPeriod",
")",
"{",
"LOG",
".",
"info",
"(",
"\"{}: Journal checkpointer shutdown has been initiated.\"",
",",
"mMaster",
".",
"getName",
"(",
")",
")",
";",
"mWaitQuietPeriod",
"=",
"waitQuietPeriod",
";"... | Initiates the shutdown of this checkpointer thread, and also waits for it to finish.
@param waitQuietPeriod whether to wait for a quiet period to pass before terminating the thread | [
"Initiates",
"the",
"shutdown",
"of",
"this",
"checkpointer",
"thread",
"and",
"also",
"waits",
"for",
"it",
"to",
"finish",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java#L101-L126 |
19,029 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java | UfsJournalCheckpointThread.maybeCheckpoint | private void maybeCheckpoint() {
if (mShutdownInitiated) {
return;
}
long nextSequenceNumber = mJournalReader.getNextSequenceNumber();
if (nextSequenceNumber - mNextSequenceNumberToCheckpoint < mCheckpointPeriodEntries) {
return;
}
try {
mNextSequenceNumberToCheckpoint = mJourn... | java | private void maybeCheckpoint() {
if (mShutdownInitiated) {
return;
}
long nextSequenceNumber = mJournalReader.getNextSequenceNumber();
if (nextSequenceNumber - mNextSequenceNumberToCheckpoint < mCheckpointPeriodEntries) {
return;
}
try {
mNextSequenceNumberToCheckpoint = mJourn... | [
"private",
"void",
"maybeCheckpoint",
"(",
")",
"{",
"if",
"(",
"mShutdownInitiated",
")",
"{",
"return",
";",
"}",
"long",
"nextSequenceNumber",
"=",
"mJournalReader",
".",
"getNextSequenceNumber",
"(",
")",
";",
"if",
"(",
"nextSequenceNumber",
"-",
"mNextSequ... | Creates a new checkpoint if necessary. | [
"Creates",
"a",
"new",
"checkpoint",
"if",
"necessary",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalCheckpointThread.java#L231-L251 |
19,030 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.addTempBlockMeta | public void addTempBlockMeta(TempBlockMeta tempBlockMeta)
throws WorkerOutOfSpaceException, BlockAlreadyExistsException {
StorageDir dir = tempBlockMeta.getParentDir();
dir.addTempBlockMeta(tempBlockMeta);
} | java | public void addTempBlockMeta(TempBlockMeta tempBlockMeta)
throws WorkerOutOfSpaceException, BlockAlreadyExistsException {
StorageDir dir = tempBlockMeta.getParentDir();
dir.addTempBlockMeta(tempBlockMeta);
} | [
"public",
"void",
"addTempBlockMeta",
"(",
"TempBlockMeta",
"tempBlockMeta",
")",
"throws",
"WorkerOutOfSpaceException",
",",
"BlockAlreadyExistsException",
"{",
"StorageDir",
"dir",
"=",
"tempBlockMeta",
".",
"getParentDir",
"(",
")",
";",
"dir",
".",
"addTempBlockMeta... | Adds a temp block.
@param tempBlockMeta the metadata of the temp block to add
@throws WorkerOutOfSpaceException when no more space left to hold the block
@throws BlockAlreadyExistsException when the block already exists | [
"Adds",
"a",
"temp",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L103-L107 |
19,031 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.cleanupSessionTempBlocks | @Deprecated
public void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds) {
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
dir.cleanupSessionTempBlocks(sessionId, tempBlockIds);
}
}
} | java | @Deprecated
public void cleanupSessionTempBlocks(long sessionId, List<Long> tempBlockIds) {
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
dir.cleanupSessionTempBlocks(sessionId, tempBlockIds);
}
}
} | [
"@",
"Deprecated",
"public",
"void",
"cleanupSessionTempBlocks",
"(",
"long",
"sessionId",
",",
"List",
"<",
"Long",
">",
"tempBlockIds",
")",
"{",
"for",
"(",
"StorageTier",
"tier",
":",
"mTiers",
")",
"{",
"for",
"(",
"StorageDir",
"dir",
":",
"tier",
".... | Cleans up the metadata of the given temp block ids.
@param sessionId the id of the client associated with the temp blocks
@param tempBlockIds the list of temporary block ids to be cleaned up, non temporary block ids
will be ignored.
@deprecated As of version 0.8. | [
"Cleans",
"up",
"the",
"metadata",
"of",
"the",
"given",
"temp",
"block",
"ids",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L139-L146 |
19,032 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.getBlockMeta | public BlockMeta getBlockMeta(long blockId) throws BlockDoesNotExistException {
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
if (dir.hasBlockMeta(blockId)) {
return dir.getBlockMeta(blockId);
}
}
}
throw new BlockDoesNotExistException... | java | public BlockMeta getBlockMeta(long blockId) throws BlockDoesNotExistException {
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
if (dir.hasBlockMeta(blockId)) {
return dir.getBlockMeta(blockId);
}
}
}
throw new BlockDoesNotExistException... | [
"public",
"BlockMeta",
"getBlockMeta",
"(",
"long",
"blockId",
")",
"throws",
"BlockDoesNotExistException",
"{",
"for",
"(",
"StorageTier",
"tier",
":",
"mTiers",
")",
"{",
"for",
"(",
"StorageDir",
"dir",
":",
"tier",
".",
"getStorageDirs",
"(",
")",
")",
"... | Gets the metadata of a block given its block id.
@param blockId the block id
@return metadata of the block
@throws BlockDoesNotExistException if no BlockMeta for this block id is found | [
"Gets",
"the",
"metadata",
"of",
"a",
"block",
"given",
"its",
"block",
"id",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L186-L195 |
19,033 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.getSessionTempBlocks | public List<TempBlockMeta> getSessionTempBlocks(long sessionId) {
List<TempBlockMeta> sessionTempBlocks = new ArrayList<>();
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
sessionTempBlocks.addAll(dir.getSessionTempBlocks(sessionId));
}
}
return sess... | java | public List<TempBlockMeta> getSessionTempBlocks(long sessionId) {
List<TempBlockMeta> sessionTempBlocks = new ArrayList<>();
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
sessionTempBlocks.addAll(dir.getSessionTempBlocks(sessionId));
}
}
return sess... | [
"public",
"List",
"<",
"TempBlockMeta",
">",
"getSessionTempBlocks",
"(",
"long",
"sessionId",
")",
"{",
"List",
"<",
"TempBlockMeta",
">",
"sessionTempBlocks",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"StorageTier",
"tier",
":",
"mTiers",
"... | Gets all the temporary blocks associated with a session, empty list is returned if the session
has no temporary blocks.
@param sessionId the id of the session
@return A list of temp blocks associated with the session | [
"Gets",
"all",
"the",
"temporary",
"blocks",
"associated",
"with",
"a",
"session",
"empty",
"list",
"is",
"returned",
"if",
"the",
"session",
"has",
"no",
"temporary",
"blocks",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L321-L329 |
19,034 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.hasBlockMeta | public boolean hasBlockMeta(long blockId) {
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
if (dir.hasBlockMeta(blockId)) {
return true;
}
}
}
return false;
} | java | public boolean hasBlockMeta(long blockId) {
for (StorageTier tier : mTiers) {
for (StorageDir dir : tier.getStorageDirs()) {
if (dir.hasBlockMeta(blockId)) {
return true;
}
}
}
return false;
} | [
"public",
"boolean",
"hasBlockMeta",
"(",
"long",
"blockId",
")",
"{",
"for",
"(",
"StorageTier",
"tier",
":",
"mTiers",
")",
"{",
"for",
"(",
"StorageDir",
"dir",
":",
"tier",
".",
"getStorageDirs",
"(",
")",
")",
"{",
"if",
"(",
"dir",
".",
"hasBlock... | Checks if the storage has a given block.
@param blockId the block id
@return true if the block is contained, false otherwise | [
"Checks",
"if",
"the",
"storage",
"has",
"a",
"given",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L337-L346 |
19,035 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.moveBlockMeta | public BlockMeta moveBlockMeta(BlockMeta blockMeta, TempBlockMeta tempBlockMeta)
throws BlockDoesNotExistException, WorkerOutOfSpaceException, BlockAlreadyExistsException {
StorageDir srcDir = blockMeta.getParentDir();
StorageDir dstDir = tempBlockMeta.getParentDir();
srcDir.removeBlockMeta(blockMeta)... | java | public BlockMeta moveBlockMeta(BlockMeta blockMeta, TempBlockMeta tempBlockMeta)
throws BlockDoesNotExistException, WorkerOutOfSpaceException, BlockAlreadyExistsException {
StorageDir srcDir = blockMeta.getParentDir();
StorageDir dstDir = tempBlockMeta.getParentDir();
srcDir.removeBlockMeta(blockMeta)... | [
"public",
"BlockMeta",
"moveBlockMeta",
"(",
"BlockMeta",
"blockMeta",
",",
"TempBlockMeta",
"tempBlockMeta",
")",
"throws",
"BlockDoesNotExistException",
",",
"WorkerOutOfSpaceException",
",",
"BlockAlreadyExistsException",
"{",
"StorageDir",
"srcDir",
"=",
"blockMeta",
".... | Moves an existing block to another location currently hold by a temp block.
@param blockMeta the metadata of the block to move
@param tempBlockMeta a placeholder in the destination directory
@return the new block metadata if success, absent otherwise
@throws BlockDoesNotExistException when the block to move is not fou... | [
"Moves",
"an",
"existing",
"block",
"to",
"another",
"location",
"currently",
"hold",
"by",
"a",
"temp",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L376-L386 |
19,036 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.removeBlockMeta | public void removeBlockMeta(BlockMeta block) throws BlockDoesNotExistException {
StorageDir dir = block.getParentDir();
dir.removeBlockMeta(block);
} | java | public void removeBlockMeta(BlockMeta block) throws BlockDoesNotExistException {
StorageDir dir = block.getParentDir();
dir.removeBlockMeta(block);
} | [
"public",
"void",
"removeBlockMeta",
"(",
"BlockMeta",
"block",
")",
"throws",
"BlockDoesNotExistException",
"{",
"StorageDir",
"dir",
"=",
"block",
".",
"getParentDir",
"(",
")",
";",
"dir",
".",
"removeBlockMeta",
"(",
"block",
")",
";",
"}"
] | Removes the metadata of a specific block.
@param block the metadata of the block to remove
@throws BlockDoesNotExistException when block is not found | [
"Removes",
"the",
"metadata",
"of",
"a",
"specific",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L447-L450 |
19,037 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.resizeTempBlockMeta | public void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize)
throws InvalidWorkerStateException {
StorageDir dir = tempBlockMeta.getParentDir();
dir.resizeTempBlockMeta(tempBlockMeta, newSize);
} | java | public void resizeTempBlockMeta(TempBlockMeta tempBlockMeta, long newSize)
throws InvalidWorkerStateException {
StorageDir dir = tempBlockMeta.getParentDir();
dir.resizeTempBlockMeta(tempBlockMeta, newSize);
} | [
"public",
"void",
"resizeTempBlockMeta",
"(",
"TempBlockMeta",
"tempBlockMeta",
",",
"long",
"newSize",
")",
"throws",
"InvalidWorkerStateException",
"{",
"StorageDir",
"dir",
"=",
"tempBlockMeta",
".",
"getParentDir",
"(",
")",
";",
"dir",
".",
"resizeTempBlockMeta",... | Modifies the size of a temp block.
@param tempBlockMeta the temp block to modify
@param newSize new size in bytes
@throws InvalidWorkerStateException when newSize is smaller than current size | [
"Modifies",
"the",
"size",
"of",
"a",
"temp",
"block",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L459-L463 |
19,038 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/authentication/SaslStreamClientDriver.java | SaslStreamClientDriver.start | public void start(String channelId) throws AlluxioStatusException {
try {
LOG.debug("Starting SASL handshake for ChannelId:{}", channelId);
// Send the server initial message.
mRequestObserver.onNext(mSaslHandshakeClientHandler.getInitialMessage(channelId));
// Wait until authentication stat... | java | public void start(String channelId) throws AlluxioStatusException {
try {
LOG.debug("Starting SASL handshake for ChannelId:{}", channelId);
// Send the server initial message.
mRequestObserver.onNext(mSaslHandshakeClientHandler.getInitialMessage(channelId));
// Wait until authentication stat... | [
"public",
"void",
"start",
"(",
"String",
"channelId",
")",
"throws",
"AlluxioStatusException",
"{",
"try",
"{",
"LOG",
".",
"debug",
"(",
"\"Starting SASL handshake for ChannelId:{}\"",
",",
"channelId",
")",
";",
"// Send the server initial message.",
"mRequestObserver"... | Starts authentication with the server and wait until completion.
@param channelId channel that is authenticating with the server
@throws UnauthenticatedException | [
"Starts",
"authentication",
"with",
"the",
"server",
"and",
"wait",
"until",
"completion",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/authentication/SaslStreamClientDriver.java#L102-L128 |
19,039 | Alluxio/alluxio | core/base/src/main/java/alluxio/underfs/UfsStatus.java | UfsStatus.convertToNames | @Nullable
public static String[] convertToNames(UfsStatus[] children) {
if (children == null) {
return null;
}
String[] ret = new String[children.length];
for (int i = 0; i < children.length; ++i) {
ret[i] = children[i].getName();
}
return ret;
} | java | @Nullable
public static String[] convertToNames(UfsStatus[] children) {
if (children == null) {
return null;
}
String[] ret = new String[children.length];
for (int i = 0; i < children.length; ++i) {
ret[i] = children[i].getName();
}
return ret;
} | [
"@",
"Nullable",
"public",
"static",
"String",
"[",
"]",
"convertToNames",
"(",
"UfsStatus",
"[",
"]",
"children",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"String",
"[",
"]",
"ret",
"=",
"new",
"String",
"... | Converts an array of UFS file status to a listing result where each element in the array is
a file or directory name.
@param children array of listing statuses
@return array of file or directory names, or null if the input is null | [
"Converts",
"an",
"array",
"of",
"UFS",
"file",
"status",
"to",
"a",
"listing",
"result",
"where",
"each",
"element",
"in",
"the",
"array",
"is",
"a",
"file",
"or",
"directory",
"name",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/underfs/UfsStatus.java#L84-L94 |
19,040 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/MasterUtils.java | MasterUtils.createMasters | public static void createMasters(MasterRegistry registry, MasterContext context) {
List<Callable<Void>> callables = new ArrayList<>();
for (final MasterFactory factory : alluxio.master.ServiceUtils.getMasterServiceLoader()) {
callables.add(() -> {
if (factory.isEnabled()) {
factory.creat... | java | public static void createMasters(MasterRegistry registry, MasterContext context) {
List<Callable<Void>> callables = new ArrayList<>();
for (final MasterFactory factory : alluxio.master.ServiceUtils.getMasterServiceLoader()) {
callables.add(() -> {
if (factory.isEnabled()) {
factory.creat... | [
"public",
"static",
"void",
"createMasters",
"(",
"MasterRegistry",
"registry",
",",
"MasterContext",
"context",
")",
"{",
"List",
"<",
"Callable",
"<",
"Void",
">>",
"callables",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"MasterFact... | Creates all the masters and registers them to the master registry.
@param registry the master registry
@param context master context | [
"Creates",
"all",
"the",
"masters",
"and",
"registers",
"them",
"to",
"the",
"master",
"registry",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/MasterUtils.java#L44-L59 |
19,041 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/evictor/EvictorUtils.java | EvictorUtils.selectDirWithRequestedSpace | @Nullable
public static StorageDirView selectDirWithRequestedSpace(long bytesToBeAvailable,
BlockStoreLocation location, BlockMetadataManagerView mManagerView) {
if (location.equals(BlockStoreLocation.anyTier())) {
for (StorageTierView tierView : mManagerView.getTierViews()) {
for (StorageDirV... | java | @Nullable
public static StorageDirView selectDirWithRequestedSpace(long bytesToBeAvailable,
BlockStoreLocation location, BlockMetadataManagerView mManagerView) {
if (location.equals(BlockStoreLocation.anyTier())) {
for (StorageTierView tierView : mManagerView.getTierViews()) {
for (StorageDirV... | [
"@",
"Nullable",
"public",
"static",
"StorageDirView",
"selectDirWithRequestedSpace",
"(",
"long",
"bytesToBeAvailable",
",",
"BlockStoreLocation",
"location",
",",
"BlockMetadataManagerView",
"mManagerView",
")",
"{",
"if",
"(",
"location",
".",
"equals",
"(",
"BlockSt... | Finds a directory in the given location range with capacity upwards of the given bound.
@param bytesToBeAvailable the capacity bound
@param location the location range
@param mManagerView the storage manager view
@return a {@link StorageDirView} in the range of location that already has availableBytes
larger than byte... | [
"Finds",
"a",
"directory",
"in",
"the",
"given",
"location",
"range",
"with",
"capacity",
"upwards",
"of",
"the",
"given",
"bound",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/evictor/EvictorUtils.java#L84-L111 |
19,042 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockReadHandler.java | ShortCircuitBlockReadHandler.onNext | @Override
public void onNext(OpenLocalBlockRequest request) {
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<OpenLocalBlockResponse>() {
@Override
public OpenLocalBlockResponse call() throws Exception {
Preconditions.checkState(mRequest == null);
mRequest = request;... | java | @Override
public void onNext(OpenLocalBlockRequest request) {
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<OpenLocalBlockResponse>() {
@Override
public OpenLocalBlockResponse call() throws Exception {
Preconditions.checkState(mRequest == null);
mRequest = request;... | [
"@",
"Override",
"public",
"void",
"onNext",
"(",
"OpenLocalBlockRequest",
"request",
")",
"{",
"RpcUtils",
".",
"streamingRPCAndLog",
"(",
"LOG",
",",
"new",
"RpcUtils",
".",
"StreamingRpcCallable",
"<",
"OpenLocalBlockResponse",
">",
"(",
")",
"{",
"@",
"Overr... | Handles block open request. | [
"Handles",
"block",
"open",
"request",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockReadHandler.java#L71-L119 |
19,043 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockReadHandler.java | ShortCircuitBlockReadHandler.onCompleted | @Override
public void onCompleted() {
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<OpenLocalBlockResponse>() {
@Override
public OpenLocalBlockResponse call() throws Exception {
if (mLockId != BlockLockManager.INVALID_LOCK_ID) {
mWorker.unlockBlock(mLockId);
... | java | @Override
public void onCompleted() {
RpcUtils.streamingRPCAndLog(LOG, new RpcUtils.StreamingRpcCallable<OpenLocalBlockResponse>() {
@Override
public OpenLocalBlockResponse call() throws Exception {
if (mLockId != BlockLockManager.INVALID_LOCK_ID) {
mWorker.unlockBlock(mLockId);
... | [
"@",
"Override",
"public",
"void",
"onCompleted",
"(",
")",
"{",
"RpcUtils",
".",
"streamingRPCAndLog",
"(",
"LOG",
",",
"new",
"RpcUtils",
".",
"StreamingRpcCallable",
"<",
"OpenLocalBlockResponse",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"OpenLocalBlock... | Handles block close request. No exceptions should be thrown. | [
"Handles",
"block",
"close",
"request",
".",
"No",
"exceptions",
"should",
"be",
"thrown",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/grpc/ShortCircuitBlockReadHandler.java#L138-L159 |
19,044 | Alluxio/alluxio | integration/mesos/src/main/java/alluxio/mesos/AlluxioFramework.java | AlluxioFramework.run | public void run() {
Protos.FrameworkInfo.Builder frameworkInfo = Protos.FrameworkInfo.newBuilder()
.setName("alluxio").setCheckpoint(true);
if (ServerConfiguration.isSet(PropertyKey.INTEGRATION_MESOS_ROLE)) {
frameworkInfo.setRole(ServerConfiguration.get(PropertyKey.INTEGRATION_MESOS_ROLE));
... | java | public void run() {
Protos.FrameworkInfo.Builder frameworkInfo = Protos.FrameworkInfo.newBuilder()
.setName("alluxio").setCheckpoint(true);
if (ServerConfiguration.isSet(PropertyKey.INTEGRATION_MESOS_ROLE)) {
frameworkInfo.setRole(ServerConfiguration.get(PropertyKey.INTEGRATION_MESOS_ROLE));
... | [
"public",
"void",
"run",
"(",
")",
"{",
"Protos",
".",
"FrameworkInfo",
".",
"Builder",
"frameworkInfo",
"=",
"Protos",
".",
"FrameworkInfo",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"\"alluxio\"",
")",
".",
"setCheckpoint",
"(",
"true",
")",
";",... | Runs the mesos framework. | [
"Runs",
"the",
"mesos",
"framework",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/mesos/src/main/java/alluxio/mesos/AlluxioFramework.java#L63-L98 |
19,045 | Alluxio/alluxio | integration/mesos/src/main/java/alluxio/mesos/AlluxioFramework.java | AlluxioFramework.createMasterWebUrl | private static String createMasterWebUrl() {
InetSocketAddress masterWeb = NetworkAddressUtils.getConnectAddress(
ServiceType.MASTER_WEB, ServerConfiguration.global());
return "http://" + masterWeb.getHostString() + ":" + masterWeb.getPort();
} | java | private static String createMasterWebUrl() {
InetSocketAddress masterWeb = NetworkAddressUtils.getConnectAddress(
ServiceType.MASTER_WEB, ServerConfiguration.global());
return "http://" + masterWeb.getHostString() + ":" + masterWeb.getPort();
} | [
"private",
"static",
"String",
"createMasterWebUrl",
"(",
")",
"{",
"InetSocketAddress",
"masterWeb",
"=",
"NetworkAddressUtils",
".",
"getConnectAddress",
"(",
"ServiceType",
".",
"MASTER_WEB",
",",
"ServerConfiguration",
".",
"global",
"(",
")",
")",
";",
"return"... | Create AlluxioMaster web url. | [
"Create",
"AlluxioMaster",
"web",
"url",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/mesos/src/main/java/alluxio/mesos/AlluxioFramework.java#L103-L107 |
19,046 | Alluxio/alluxio | integration/mesos/src/main/java/alluxio/mesos/AlluxioFramework.java | AlluxioFramework.main | public static void main(String[] args) throws Exception {
AlluxioFramework framework = new AlluxioFramework();
JCommander jc = new JCommander(framework);
try {
jc.parse(args);
} catch (Exception e) {
System.out.println(e.getMessage());
jc.usage();
System.exit(1);
}
framew... | java | public static void main(String[] args) throws Exception {
AlluxioFramework framework = new AlluxioFramework();
JCommander jc = new JCommander(framework);
try {
jc.parse(args);
} catch (Exception e) {
System.out.println(e.getMessage());
jc.usage();
System.exit(1);
}
framew... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"AlluxioFramework",
"framework",
"=",
"new",
"AlluxioFramework",
"(",
")",
";",
"JCommander",
"jc",
"=",
"new",
"JCommander",
"(",
"framework",
")",
";",
... | Starts the Alluxio framework.
@param args command-line arguments | [
"Starts",
"the",
"Alluxio",
"framework",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/integration/mesos/src/main/java/alluxio/mesos/AlluxioFramework.java#L133-L144 |
19,047 | Alluxio/alluxio | core/common/src/main/java/alluxio/network/TieredIdentityFactory.java | TieredIdentityFactory.create | @VisibleForTesting
static TieredIdentity create(AlluxioConfiguration conf) {
TieredIdentity scriptIdentity = fromScript(conf);
List<LocalityTier> tiers = new ArrayList<>();
List<String> orderedTierNames = conf.getList(PropertyKey.LOCALITY_ORDER, ",");
for (int i = 0; i < orderedTierNames.size(); i++)... | java | @VisibleForTesting
static TieredIdentity create(AlluxioConfiguration conf) {
TieredIdentity scriptIdentity = fromScript(conf);
List<LocalityTier> tiers = new ArrayList<>();
List<String> orderedTierNames = conf.getList(PropertyKey.LOCALITY_ORDER, ",");
for (int i = 0; i < orderedTierNames.size(); i++)... | [
"@",
"VisibleForTesting",
"static",
"TieredIdentity",
"create",
"(",
"AlluxioConfiguration",
"conf",
")",
"{",
"TieredIdentity",
"scriptIdentity",
"=",
"fromScript",
"(",
"conf",
")",
";",
"List",
"<",
"LocalityTier",
">",
"tiers",
"=",
"new",
"ArrayList",
"<>",
... | Creates a tiered identity based on configuration.
@return the created tiered identity | [
"Creates",
"a",
"tiered",
"identity",
"based",
"on",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/network/TieredIdentityFactory.java#L75-L102 |
19,048 | Alluxio/alluxio | core/common/src/main/java/alluxio/underfs/UnderFileSystemConfiguration.java | UnderFileSystemConfiguration.createMountSpecificConf | public UnderFileSystemConfiguration createMountSpecificConf(Map<String, String> mountConf) {
UnderFileSystemConfiguration ufsConf = new UnderFileSystemConfiguration(mProperties.copy());
ufsConf.mProperties.merge(mountConf, Source.MOUNT_OPTION);
ufsConf.mReadOnly = mReadOnly;
ufsConf.mShared = mShared;
... | java | public UnderFileSystemConfiguration createMountSpecificConf(Map<String, String> mountConf) {
UnderFileSystemConfiguration ufsConf = new UnderFileSystemConfiguration(mProperties.copy());
ufsConf.mProperties.merge(mountConf, Source.MOUNT_OPTION);
ufsConf.mReadOnly = mReadOnly;
ufsConf.mShared = mShared;
... | [
"public",
"UnderFileSystemConfiguration",
"createMountSpecificConf",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"mountConf",
")",
"{",
"UnderFileSystemConfiguration",
"ufsConf",
"=",
"new",
"UnderFileSystemConfiguration",
"(",
"mProperties",
".",
"copy",
"(",
")",
... | Creates a new instance from the current configuration and adds in new properties.
@param mountConf the mount specific configuration map
@return the updated configuration object | [
"Creates",
"a",
"new",
"instance",
"from",
"the",
"current",
"configuration",
"and",
"adds",
"in",
"new",
"properties",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/UnderFileSystemConfiguration.java#L121-L127 |
19,049 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMasterSync.java | BlockMasterSync.registerWithMaster | private void registerWithMaster() throws IOException {
BlockStoreMeta storeMeta = mBlockWorker.getStoreMetaFull();
StorageTierAssoc storageTierAssoc = new WorkerStorageTierAssoc();
List<ConfigProperty> configList =
ConfigurationUtils.getConfiguration(ServerConfiguration.global(), Scope.WORKER);
... | java | private void registerWithMaster() throws IOException {
BlockStoreMeta storeMeta = mBlockWorker.getStoreMetaFull();
StorageTierAssoc storageTierAssoc = new WorkerStorageTierAssoc();
List<ConfigProperty> configList =
ConfigurationUtils.getConfiguration(ServerConfiguration.global(), Scope.WORKER);
... | [
"private",
"void",
"registerWithMaster",
"(",
")",
"throws",
"IOException",
"{",
"BlockStoreMeta",
"storeMeta",
"=",
"mBlockWorker",
".",
"getStoreMetaFull",
"(",
")",
";",
"StorageTierAssoc",
"storageTierAssoc",
"=",
"new",
"WorkerStorageTierAssoc",
"(",
")",
";",
... | Registers with the Alluxio master. This should be called before the continuous heartbeat thread
begins. | [
"Registers",
"with",
"the",
"Alluxio",
"master",
".",
"This",
"should",
"be",
"called",
"before",
"the",
"continuous",
"heartbeat",
"thread",
"begins",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMasterSync.java#L103-L112 |
19,050 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMasterSync.java | BlockMasterSync.heartbeat | @Override
public void heartbeat() {
// Prepare metadata for the next heartbeat
BlockHeartbeatReport blockReport = mBlockWorker.getReport();
BlockStoreMeta storeMeta = mBlockWorker.getStoreMeta();
// Send the heartbeat and execute the response
Command cmdFromMaster = null;
List<alluxio.grpc.Me... | java | @Override
public void heartbeat() {
// Prepare metadata for the next heartbeat
BlockHeartbeatReport blockReport = mBlockWorker.getReport();
BlockStoreMeta storeMeta = mBlockWorker.getStoreMeta();
// Send the heartbeat and execute the response
Command cmdFromMaster = null;
List<alluxio.grpc.Me... | [
"@",
"Override",
"public",
"void",
"heartbeat",
"(",
")",
"{",
"// Prepare metadata for the next heartbeat",
"BlockHeartbeatReport",
"blockReport",
"=",
"mBlockWorker",
".",
"getReport",
"(",
")",
";",
"BlockStoreMeta",
"storeMeta",
"=",
"mBlockWorker",
".",
"getStoreMe... | Heartbeats to the master node about the change in the worker's managed space. | [
"Heartbeats",
"to",
"the",
"master",
"node",
"about",
"the",
"change",
"in",
"the",
"worker",
"s",
"managed",
"space",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMasterSync.java#L117-L155 |
19,051 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/raft/JournalStateMachine.java | JournalStateMachine.applyEntry | private void applyEntry(JournalEntry entry) {
Preconditions.checkState(
entry.getAllFields().size() <= 1
|| (entry.getAllFields().size() == 2 && entry.hasSequenceNumber()),
"Raft journal entries should never set multiple fields in addition to sequence "
+ "number, but found %... | java | private void applyEntry(JournalEntry entry) {
Preconditions.checkState(
entry.getAllFields().size() <= 1
|| (entry.getAllFields().size() == 2 && entry.hasSequenceNumber()),
"Raft journal entries should never set multiple fields in addition to sequence "
+ "number, but found %... | [
"private",
"void",
"applyEntry",
"(",
"JournalEntry",
"entry",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"entry",
".",
"getAllFields",
"(",
")",
".",
"size",
"(",
")",
"<=",
"1",
"||",
"(",
"entry",
".",
"getAllFields",
"(",
")",
".",
"size",
... | Applies the journal entry, ignoring empty entries and expanding multi-entries.
@param entry the entry to apply | [
"Applies",
"the",
"journal",
"entry",
"ignoring",
"empty",
"entries",
"and",
"expanding",
"multi",
"-",
"entries",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/raft/JournalStateMachine.java#L110-L132 |
19,052 | Alluxio/alluxio | core/common/src/main/java/alluxio/underfs/UnderFileSystemFactoryRegistry.java | UnderFileSystemFactoryRegistry.findAll | public static List<UnderFileSystemFactory> findAll(String path,
UnderFileSystemConfiguration ufsConf, AlluxioConfiguration alluxioConf) {
List<UnderFileSystemFactory> eligibleFactories = sRegistryInstance.findAll(path, ufsConf,
alluxioConf);
if (eligibleFactories.isEmpty() && ufsConf != null) {
... | java | public static List<UnderFileSystemFactory> findAll(String path,
UnderFileSystemConfiguration ufsConf, AlluxioConfiguration alluxioConf) {
List<UnderFileSystemFactory> eligibleFactories = sRegistryInstance.findAll(path, ufsConf,
alluxioConf);
if (eligibleFactories.isEmpty() && ufsConf != null) {
... | [
"public",
"static",
"List",
"<",
"UnderFileSystemFactory",
">",
"findAll",
"(",
"String",
"path",
",",
"UnderFileSystemConfiguration",
"ufsConf",
",",
"AlluxioConfiguration",
"alluxioConf",
")",
"{",
"List",
"<",
"UnderFileSystemFactory",
">",
"eligibleFactories",
"=",
... | Finds all the Under File System factories that support the given path.
@param path path
@param ufsConf configuration of the UFS
@param alluxioConf Alluxio configuration
@return list of factories that support the given path which may be an empty list | [
"Finds",
"all",
"the",
"Under",
"File",
"System",
"factories",
"that",
"support",
"the",
"given",
"path",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/underfs/UnderFileSystemFactoryRegistry.java#L110-L131 |
19,053 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/DistributedLoadCommand.java | DistributedLoadCommand.load | private void load(AlluxioURI filePath, int replication)
throws AlluxioException, IOException, InterruptedException {
URIStatus status = mFileSystem.getStatus(filePath);
if (status.isFolder()) {
List<URIStatus> statuses = mFileSystem.listStatus(filePath);
for (URIStatus uriStatus : statuses) {
... | java | private void load(AlluxioURI filePath, int replication)
throws AlluxioException, IOException, InterruptedException {
URIStatus status = mFileSystem.getStatus(filePath);
if (status.isFolder()) {
List<URIStatus> statuses = mFileSystem.listStatus(filePath);
for (URIStatus uriStatus : statuses) {
... | [
"private",
"void",
"load",
"(",
"AlluxioURI",
"filePath",
",",
"int",
"replication",
")",
"throws",
"AlluxioException",
",",
"IOException",
",",
"InterruptedException",
"{",
"URIStatus",
"status",
"=",
"mFileSystem",
".",
"getStatus",
"(",
"filePath",
")",
";",
... | Loads a file or directory in Alluxio space, makes it resident in memory.
@param filePath The {@link AlluxioURI} path to load into Alluxio memory
@throws AlluxioException when Alluxio exception occurs
@throws IOException when non-Alluxio exception occurs | [
"Loads",
"a",
"file",
"or",
"directory",
"in",
"Alluxio",
"space",
"makes",
"it",
"resident",
"in",
"memory",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/DistributedLoadCommand.java#L92-L112 |
19,054 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/underfs/AbstractUfsManager.java | AbstractUfsManager.getOrAdd | private UnderFileSystem getOrAdd(AlluxioURI ufsUri, UnderFileSystemConfiguration ufsConf) {
Key key = new Key(ufsUri, ufsConf.getMountSpecificConf());
UnderFileSystem cachedFs = mUnderFileSystemMap.get(key);
if (cachedFs != null) {
return cachedFs;
}
// On cache miss, synchronize the creation ... | java | private UnderFileSystem getOrAdd(AlluxioURI ufsUri, UnderFileSystemConfiguration ufsConf) {
Key key = new Key(ufsUri, ufsConf.getMountSpecificConf());
UnderFileSystem cachedFs = mUnderFileSystemMap.get(key);
if (cachedFs != null) {
return cachedFs;
}
// On cache miss, synchronize the creation ... | [
"private",
"UnderFileSystem",
"getOrAdd",
"(",
"AlluxioURI",
"ufsUri",
",",
"UnderFileSystemConfiguration",
"ufsConf",
")",
"{",
"Key",
"key",
"=",
"new",
"Key",
"(",
"ufsUri",
",",
"ufsConf",
".",
"getMountSpecificConf",
"(",
")",
")",
";",
"UnderFileSystem",
"... | Return a UFS instance if it already exists in the cache, otherwise, creates a new instance and
return this.
@param ufsUri the UFS path
@param ufsConf the UFS configuration
@return the UFS instance | [
"Return",
"a",
"UFS",
"instance",
"if",
"it",
"already",
"exists",
"in",
"the",
"cache",
"otherwise",
"creates",
"a",
"new",
"instance",
"and",
"return",
"this",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/underfs/AbstractUfsManager.java#L116-L149 |
19,055 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.getAlluxioURIs | private static List<AlluxioURI> getAlluxioURIs(FileSystem alluxioClient, AlluxioURI inputURI,
AlluxioURI parentDir) throws IOException {
List<AlluxioURI> res = new ArrayList<>();
List<URIStatus> statuses;
try {
statuses = alluxioClient.listStatus(parentDir);
} catch (AlluxioException e) {
... | java | private static List<AlluxioURI> getAlluxioURIs(FileSystem alluxioClient, AlluxioURI inputURI,
AlluxioURI parentDir) throws IOException {
List<AlluxioURI> res = new ArrayList<>();
List<URIStatus> statuses;
try {
statuses = alluxioClient.listStatus(parentDir);
} catch (AlluxioException e) {
... | [
"private",
"static",
"List",
"<",
"AlluxioURI",
">",
"getAlluxioURIs",
"(",
"FileSystem",
"alluxioClient",
",",
"AlluxioURI",
"inputURI",
",",
"AlluxioURI",
"parentDir",
")",
"throws",
"IOException",
"{",
"List",
"<",
"AlluxioURI",
">",
"res",
"=",
"new",
"Array... | The utility function used to implement getAlluxioURIs.
Basically, it recursively iterates through the directory from the parent directory of inputURI
(e.g., for input "/a/b/*", it will start from "/a/b") until it finds all the matches;
It does not go into a directory if the prefix mismatches
(e.g., for input "/a/b/*",... | [
"The",
"utility",
"function",
"used",
"to",
"implement",
"getAlluxioURIs",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L135-L161 |
19,056 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.getFiles | private static List<File> getFiles(String inputPath, String parent) {
List<File> res = new ArrayList<>();
File pFile = new File(parent);
if (!pFile.exists() || !pFile.isDirectory()) {
return res;
}
if (pFile.isDirectory() && pFile.canRead()) {
File[] fileList = pFile.listFiles();
i... | java | private static List<File> getFiles(String inputPath, String parent) {
List<File> res = new ArrayList<>();
File pFile = new File(parent);
if (!pFile.exists() || !pFile.isDirectory()) {
return res;
}
if (pFile.isDirectory() && pFile.canRead()) {
File[] fileList = pFile.listFiles();
i... | [
"private",
"static",
"List",
"<",
"File",
">",
"getFiles",
"(",
"String",
"inputPath",
",",
"String",
"parent",
")",
"{",
"List",
"<",
"File",
">",
"res",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"File",
"pFile",
"=",
"new",
"File",
"(",
"parent... | The utility function used to implement getFiles.
It follows the same algorithm as {@link #getAlluxioURIs}.
@param inputPath the input file path (could contain wildcards)
@param parent the directory in which we are searching matched files
@return a list of files that matches the input path in the parent directory | [
"The",
"utility",
"function",
"used",
"to",
"implement",
"getFiles",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L195-L221 |
19,057 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.getIntArg | public static int getIntArg(CommandLine cl, Option option, int defaultValue) {
int arg = defaultValue;
if (cl.hasOption(option.getLongOpt())) {
String argOption = cl.getOptionValue(option.getLongOpt());
arg = Integer.parseInt(argOption);
}
return arg;
} | java | public static int getIntArg(CommandLine cl, Option option, int defaultValue) {
int arg = defaultValue;
if (cl.hasOption(option.getLongOpt())) {
String argOption = cl.getOptionValue(option.getLongOpt());
arg = Integer.parseInt(argOption);
}
return arg;
} | [
"public",
"static",
"int",
"getIntArg",
"(",
"CommandLine",
"cl",
",",
"Option",
"option",
",",
"int",
"defaultValue",
")",
"{",
"int",
"arg",
"=",
"defaultValue",
";",
"if",
"(",
"cl",
".",
"hasOption",
"(",
"option",
".",
"getLongOpt",
"(",
")",
")",
... | Gets the value of an option from the command line.
@param cl command line object
@param option the option to check for in the command line
@param defaultValue default value for the option
@return argument from command line or default if not present | [
"Gets",
"the",
"value",
"of",
"an",
"option",
"from",
"the",
"command",
"line",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L231-L238 |
19,058 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.getMs | public static long getMs(String time) {
try {
return FormatUtils.parseTimeSize(time);
} catch (Exception e) {
throw new RuntimeException(ExceptionMessage.INVALID_TIME.getMessage(time));
}
} | java | public static long getMs(String time) {
try {
return FormatUtils.parseTimeSize(time);
} catch (Exception e) {
throw new RuntimeException(ExceptionMessage.INVALID_TIME.getMessage(time));
}
} | [
"public",
"static",
"long",
"getMs",
"(",
"String",
"time",
")",
"{",
"try",
"{",
"return",
"FormatUtils",
".",
"parseTimeSize",
"(",
"time",
")",
";",
"}",
"catch",
"(",
"Exception",
"e",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"ExceptionMessag... | Converts the input time into millisecond unit.
@param time the time to be converted into milliseconds
@return the time in millisecond unit | [
"Converts",
"the",
"input",
"time",
"into",
"millisecond",
"unit",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L258-L264 |
19,059 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.match | private static boolean match(AlluxioURI fileURI, AlluxioURI patternURI) {
return escape(fileURI.getPath()).matches(replaceWildcards(patternURI.getPath()));
} | java | private static boolean match(AlluxioURI fileURI, AlluxioURI patternURI) {
return escape(fileURI.getPath()).matches(replaceWildcards(patternURI.getPath()));
} | [
"private",
"static",
"boolean",
"match",
"(",
"AlluxioURI",
"fileURI",
",",
"AlluxioURI",
"patternURI",
")",
"{",
"return",
"escape",
"(",
"fileURI",
".",
"getPath",
"(",
")",
")",
".",
"matches",
"(",
"replaceWildcards",
"(",
"patternURI",
".",
"getPath",
"... | Returns whether or not fileURI matches the patternURI.
@param fileURI the {@link AlluxioURI} of a particular file
@param patternURI the URI that can contain wildcards
@return true if matches; false if not | [
"Returns",
"whether",
"or",
"not",
"fileURI",
"matches",
"the",
"patternURI",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L295-L297 |
19,060 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java | FileSystemShellUtils.match | public static boolean match(String filePath, String patternPath) {
return match(new AlluxioURI(filePath), new AlluxioURI(patternPath));
} | java | public static boolean match(String filePath, String patternPath) {
return match(new AlluxioURI(filePath), new AlluxioURI(patternPath));
} | [
"public",
"static",
"boolean",
"match",
"(",
"String",
"filePath",
",",
"String",
"patternPath",
")",
"{",
"return",
"match",
"(",
"new",
"AlluxioURI",
"(",
"filePath",
")",
",",
"new",
"AlluxioURI",
"(",
"patternPath",
")",
")",
";",
"}"
] | Returns whether or not filePath matches patternPath.
@param filePath path of a given file
@param patternPath path that can contain wildcards
@return true if matches; false if not | [
"Returns",
"whether",
"or",
"not",
"filePath",
"matches",
"patternPath",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/FileSystemShellUtils.java#L306-L308 |
19,061 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/underfs/MasterUfsManager.java | MasterUfsManager.setUfsMode | public synchronized void setUfsMode(Supplier<JournalContext> journalContext, AlluxioURI ufsPath,
UfsMode ufsMode) throws InvalidPathException {
LOG.info("Set ufs mode for {} to {}", ufsPath, ufsMode);
String root = ufsPath.getRootPath();
if (!mUfsRoots.contains(root)) {
LOG.warn("No managed ufs... | java | public synchronized void setUfsMode(Supplier<JournalContext> journalContext, AlluxioURI ufsPath,
UfsMode ufsMode) throws InvalidPathException {
LOG.info("Set ufs mode for {} to {}", ufsPath, ufsMode);
String root = ufsPath.getRootPath();
if (!mUfsRoots.contains(root)) {
LOG.warn("No managed ufs... | [
"public",
"synchronized",
"void",
"setUfsMode",
"(",
"Supplier",
"<",
"JournalContext",
">",
"journalContext",
",",
"AlluxioURI",
"ufsPath",
",",
"UfsMode",
"ufsMode",
")",
"throws",
"InvalidPathException",
"{",
"LOG",
".",
"info",
"(",
"\"Set ufs mode for {} to {}\""... | Set the operation mode the given physical ufs.
@param journalContext the journal context
@param ufsPath the physical ufs path (scheme and authority only)
@param ufsMode the ufs operation mode
@throws InvalidPathException if no managed ufs covers the given path | [
"Set",
"the",
"operation",
"mode",
"the",
"given",
"physical",
"ufs",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/underfs/MasterUfsManager.java#L110-L124 |
19,062 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java | CountedCompleter.getRoot | public final CountedCompleter<?> getRoot() {
CountedCompleter<?> a = this, p;
while ((p = a.completer) != null)
a = p;
return a;
} | java | public final CountedCompleter<?> getRoot() {
CountedCompleter<?> a = this, p;
while ((p = a.completer) != null)
a = p;
return a;
} | [
"public",
"final",
"CountedCompleter",
"<",
"?",
">",
"getRoot",
"(",
")",
"{",
"CountedCompleter",
"<",
"?",
">",
"a",
"=",
"this",
",",
"p",
";",
"while",
"(",
"(",
"p",
"=",
"a",
".",
"completer",
")",
"!=",
"null",
")",
"a",
"=",
"p",
";",
... | Returns the root of the current computation; i.e., this task if it has no completer, else its
completer's root.
@return the root of the current computation | [
"Returns",
"the",
"root",
"of",
"the",
"current",
"computation",
";",
"i",
".",
"e",
".",
"this",
"task",
"if",
"it",
"has",
"no",
"completer",
"else",
"its",
"completer",
"s",
"root",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java#L534-L539 |
19,063 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java | CountedCompleter.helpComplete | public final void helpComplete(int maxTasks) {
Thread t;
ForkJoinWorkerThread wt;
if (maxTasks > 0 && status >= 0) {
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
(wt = (ForkJoinWorkerThread) t).pool.helpComplete(wt.workQueue, this, maxTasks);
else
ForkJoinPoo... | java | public final void helpComplete(int maxTasks) {
Thread t;
ForkJoinWorkerThread wt;
if (maxTasks > 0 && status >= 0) {
if ((t = Thread.currentThread()) instanceof ForkJoinWorkerThread)
(wt = (ForkJoinWorkerThread) t).pool.helpComplete(wt.workQueue, this, maxTasks);
else
ForkJoinPoo... | [
"public",
"final",
"void",
"helpComplete",
"(",
"int",
"maxTasks",
")",
"{",
"Thread",
"t",
";",
"ForkJoinWorkerThread",
"wt",
";",
"if",
"(",
"maxTasks",
">",
"0",
"&&",
"status",
">=",
"0",
")",
"{",
"if",
"(",
"(",
"t",
"=",
"Thread",
".",
"curren... | If this task has not completed, attempts to process at most the given number of other
unprocessed tasks for which this task is on the completion path, if any are known to exist.
@param maxTasks the maximum number of tasks to process. If less than or equal to zero, then no
tasks are processed. | [
"If",
"this",
"task",
"has",
"not",
"completed",
"attempts",
"to",
"process",
"at",
"most",
"the",
"given",
"number",
"of",
"other",
"unprocessed",
"tasks",
"for",
"which",
"this",
"task",
"is",
"on",
"the",
"completion",
"path",
"if",
"any",
"are",
"known... | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java#L669-L678 |
19,064 | Alluxio/alluxio | core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java | CountedCompleter.internalPropagateException | void internalPropagateException(Throwable ex) {
CountedCompleter<?> a = this, s = a;
while (a.onExceptionalCompletion(ex, s) && (a = (s = a).completer) != null && a.status >= 0
&& a.recordExceptionalCompletion(ex) == EXCEPTIONAL);
} | java | void internalPropagateException(Throwable ex) {
CountedCompleter<?> a = this, s = a;
while (a.onExceptionalCompletion(ex, s) && (a = (s = a).completer) != null && a.status >= 0
&& a.recordExceptionalCompletion(ex) == EXCEPTIONAL);
} | [
"void",
"internalPropagateException",
"(",
"Throwable",
"ex",
")",
"{",
"CountedCompleter",
"<",
"?",
">",
"a",
"=",
"this",
",",
"s",
"=",
"a",
";",
"while",
"(",
"a",
".",
"onExceptionalCompletion",
"(",
"ex",
",",
"s",
")",
"&&",
"(",
"a",
"=",
"(... | Supports ForkJoinTask exception propagation. | [
"Supports",
"ForkJoinTask",
"exception",
"propagation",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/concurrent/jsr/CountedCompleter.java#L683-L687 |
19,065 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/proto/ProtoUtils.java | ProtoUtils.toProto | public static PStatus toProto(Status status) {
switch (status.getCode()) {
case ABORTED:
return PStatus.ABORTED;
case ALREADY_EXISTS:
return PStatus.ALREADY_EXISTS;
case CANCELLED:
return PStatus.CANCELED;
case DATA_LOSS:
return PStatus.DATA_LOSS;
case D... | java | public static PStatus toProto(Status status) {
switch (status.getCode()) {
case ABORTED:
return PStatus.ABORTED;
case ALREADY_EXISTS:
return PStatus.ALREADY_EXISTS;
case CANCELLED:
return PStatus.CANCELED;
case DATA_LOSS:
return PStatus.DATA_LOSS;
case D... | [
"public",
"static",
"PStatus",
"toProto",
"(",
"Status",
"status",
")",
"{",
"switch",
"(",
"status",
".",
"getCode",
"(",
")",
")",
"{",
"case",
"ABORTED",
":",
"return",
"PStatus",
".",
"ABORTED",
";",
"case",
"ALREADY_EXISTS",
":",
"return",
"PStatus",
... | Converts an internal exception status to a protocol buffer type status.
@param status the status to convert
@return the protocol buffer type status | [
"Converts",
"an",
"internal",
"exception",
"status",
"to",
"a",
"protocol",
"buffer",
"type",
"status",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/proto/ProtoUtils.java#L228-L267 |
19,066 | Alluxio/alluxio | core/common/src/main/java/alluxio/util/proto/ProtoUtils.java | ProtoUtils.fromProto | public static SetAclAction fromProto(File.PSetAclAction pSetAclAction) {
if (pSetAclAction == null) {
throw new IllegalStateException("Null proto set acl action.");
}
switch (pSetAclAction) {
case REPLACE:
return SetAclAction.REPLACE;
case MODIFY:
return SetAclAction.MODIFY... | java | public static SetAclAction fromProto(File.PSetAclAction pSetAclAction) {
if (pSetAclAction == null) {
throw new IllegalStateException("Null proto set acl action.");
}
switch (pSetAclAction) {
case REPLACE:
return SetAclAction.REPLACE;
case MODIFY:
return SetAclAction.MODIFY... | [
"public",
"static",
"SetAclAction",
"fromProto",
"(",
"File",
".",
"PSetAclAction",
"pSetAclAction",
")",
"{",
"if",
"(",
"pSetAclAction",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Null proto set acl action.\"",
")",
";",
"}",
"switc... | Converts proto type to wire type.
@param pSetAclAction {@link File.PSetAclAction}
@return {@link SetAclAction} equivalent | [
"Converts",
"proto",
"type",
"to",
"wire",
"type",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/proto/ProtoUtils.java#L433-L451 |
19,067 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/doctor/ConfigurationCommand.java | ConfigurationCommand.run | public int run() throws IOException {
ConfigCheckReport report = mMetaMasterClient.getConfigReport();
ConfigStatus configStatus = report.getConfigStatus();
if (configStatus == ConfigStatus.PASSED) {
// No errors or warnings to show
mPrintStream.println("No server-side configuration errors or war... | java | public int run() throws IOException {
ConfigCheckReport report = mMetaMasterClient.getConfigReport();
ConfigStatus configStatus = report.getConfigStatus();
if (configStatus == ConfigStatus.PASSED) {
// No errors or warnings to show
mPrintStream.println("No server-side configuration errors or war... | [
"public",
"int",
"run",
"(",
")",
"throws",
"IOException",
"{",
"ConfigCheckReport",
"report",
"=",
"mMetaMasterClient",
".",
"getConfigReport",
"(",
")",
";",
"ConfigStatus",
"configStatus",
"=",
"report",
".",
"getConfigStatus",
"(",
")",
";",
"if",
"(",
"co... | Runs doctor configuration command.
@return 0 on success, 1 otherwise | [
"Runs",
"doctor",
"configuration",
"command",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/doctor/ConfigurationCommand.java#L49-L72 |
19,068 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/doctor/ConfigurationCommand.java | ConfigurationCommand.printInconsistentProperties | private void printInconsistentProperties(
Map<Scope, List<InconsistentProperty>> inconsistentProperties) {
for (List<InconsistentProperty> list : inconsistentProperties.values()) {
for (InconsistentProperty prop : list) {
mPrintStream.println("key: " + prop.getName());
for (Map.Entry<Opt... | java | private void printInconsistentProperties(
Map<Scope, List<InconsistentProperty>> inconsistentProperties) {
for (List<InconsistentProperty> list : inconsistentProperties.values()) {
for (InconsistentProperty prop : list) {
mPrintStream.println("key: " + prop.getName());
for (Map.Entry<Opt... | [
"private",
"void",
"printInconsistentProperties",
"(",
"Map",
"<",
"Scope",
",",
"List",
"<",
"InconsistentProperty",
">",
">",
"inconsistentProperties",
")",
"{",
"for",
"(",
"List",
"<",
"InconsistentProperty",
">",
"list",
":",
"inconsistentProperties",
".",
"v... | Prints the inconsistent properties in server-side configuration.
@param inconsistentProperties the inconsistent properties to print | [
"Prints",
"the",
"inconsistent",
"properties",
"in",
"server",
"-",
"side",
"configuration",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/doctor/ConfigurationCommand.java#L79-L91 |
19,069 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java | AbstractLocalAlluxioCluster.startProxy | private void startProxy() throws Exception {
mProxyProcess = ProxyProcess.Factory.create();
Runnable runProxy = () -> {
try {
mProxyProcess.start();
} catch (InterruptedException e) {
// this is expected
} catch (Exception e) {
// Log the exception as the RuntimeExcepti... | java | private void startProxy() throws Exception {
mProxyProcess = ProxyProcess.Factory.create();
Runnable runProxy = () -> {
try {
mProxyProcess.start();
} catch (InterruptedException e) {
// this is expected
} catch (Exception e) {
// Log the exception as the RuntimeExcepti... | [
"private",
"void",
"startProxy",
"(",
")",
"throws",
"Exception",
"{",
"mProxyProcess",
"=",
"ProxyProcess",
".",
"Factory",
".",
"create",
"(",
")",
";",
"Runnable",
"runProxy",
"=",
"(",
")",
"->",
"{",
"try",
"{",
"mProxyProcess",
".",
"start",
"(",
"... | Configures and starts the proxy. | [
"Configures",
"and",
"starts",
"the",
"proxy",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java#L111-L129 |
19,070 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java | AbstractLocalAlluxioCluster.formatAndRestartMasters | public void formatAndRestartMasters() throws Exception {
stopMasters();
Format.format(Format.Mode.MASTER, ServerConfiguration.global());
startMasters();
} | java | public void formatAndRestartMasters() throws Exception {
stopMasters();
Format.format(Format.Mode.MASTER, ServerConfiguration.global());
startMasters();
} | [
"public",
"void",
"formatAndRestartMasters",
"(",
")",
"throws",
"Exception",
"{",
"stopMasters",
"(",
")",
";",
"Format",
".",
"format",
"(",
"Format",
".",
"Mode",
".",
"MASTER",
",",
"ServerConfiguration",
".",
"global",
"(",
")",
")",
";",
"startMasters"... | Stops the masters, formats them, and then restarts them. This is useful if a fresh state is
desired, for example when restoring from a backup. | [
"Stops",
"the",
"masters",
"formats",
"them",
"and",
"then",
"restarts",
"them",
".",
"This",
"is",
"useful",
"if",
"a",
"fresh",
"state",
"is",
"desired",
"for",
"example",
"when",
"restoring",
"from",
"a",
"backup",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java#L216-L220 |
19,071 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java | AbstractLocalAlluxioCluster.stopProxy | protected void stopProxy() throws Exception {
mProxyProcess.stop();
if (mProxyThread != null) {
while (mProxyThread.isAlive()) {
LOG.info("Stopping thread {}.", mProxyThread.getName());
mProxyThread.interrupt();
mProxyThread.join(1000);
}
mProxyThread = null;
}
} | java | protected void stopProxy() throws Exception {
mProxyProcess.stop();
if (mProxyThread != null) {
while (mProxyThread.isAlive()) {
LOG.info("Stopping thread {}.", mProxyThread.getName());
mProxyThread.interrupt();
mProxyThread.join(1000);
}
mProxyThread = null;
}
} | [
"protected",
"void",
"stopProxy",
"(",
")",
"throws",
"Exception",
"{",
"mProxyProcess",
".",
"stop",
"(",
")",
";",
"if",
"(",
"mProxyThread",
"!=",
"null",
")",
"{",
"while",
"(",
"mProxyThread",
".",
"isAlive",
"(",
")",
")",
"{",
"LOG",
".",
"info"... | Stops the proxy. | [
"Stops",
"the",
"proxy",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java#L230-L240 |
19,072 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java | AbstractLocalAlluxioCluster.stopWorkers | public void stopWorkers() throws Exception {
if (mWorkers == null) {
return;
}
for (WorkerProcess worker : mWorkers) {
worker.stop();
}
for (Thread thread : mWorkerThreads) {
while (thread.isAlive()) {
LOG.info("Stopping thread {}.", thread.getName());
thread.interr... | java | public void stopWorkers() throws Exception {
if (mWorkers == null) {
return;
}
for (WorkerProcess worker : mWorkers) {
worker.stop();
}
for (Thread thread : mWorkerThreads) {
while (thread.isAlive()) {
LOG.info("Stopping thread {}.", thread.getName());
thread.interr... | [
"public",
"void",
"stopWorkers",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"mWorkers",
"==",
"null",
")",
"{",
"return",
";",
"}",
"for",
"(",
"WorkerProcess",
"worker",
":",
"mWorkers",
")",
"{",
"worker",
".",
"stop",
"(",
")",
";",
"}",
"fo... | Stops the workers. | [
"Stops",
"the",
"workers",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java#L245-L260 |
19,073 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java | AbstractLocalAlluxioCluster.waitForWorkersRegistered | public void waitForWorkersRegistered(int timeoutMs)
throws TimeoutException, InterruptedException, IOException {
try (MetaMasterClient client =
new RetryHandlingMetaMasterClient(MasterClientContext
.newBuilder(ClientContext.create(ServerConfiguration.global())).build())) {
... | java | public void waitForWorkersRegistered(int timeoutMs)
throws TimeoutException, InterruptedException, IOException {
try (MetaMasterClient client =
new RetryHandlingMetaMasterClient(MasterClientContext
.newBuilder(ClientContext.create(ServerConfiguration.global())).build())) {
... | [
"public",
"void",
"waitForWorkersRegistered",
"(",
"int",
"timeoutMs",
")",
"throws",
"TimeoutException",
",",
"InterruptedException",
",",
"IOException",
"{",
"try",
"(",
"MetaMasterClient",
"client",
"=",
"new",
"RetryHandlingMetaMasterClient",
"(",
"MasterClientContext... | Waits for all workers registered with master.
@param timeoutMs the timeout to wait | [
"Waits",
"for",
"all",
"workers",
"registered",
"with",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/AbstractLocalAlluxioCluster.java#L299-L315 |
19,074 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java | LocalAlluxioMaster.create | public static LocalAlluxioMaster create(boolean includeSecondary) throws IOException {
String workDirectory = uniquePath();
FileUtils.deletePathRecursively(workDirectory);
ServerConfiguration.set(PropertyKey.WORK_DIR, workDirectory);
return create(workDirectory, includeSecondary);
} | java | public static LocalAlluxioMaster create(boolean includeSecondary) throws IOException {
String workDirectory = uniquePath();
FileUtils.deletePathRecursively(workDirectory);
ServerConfiguration.set(PropertyKey.WORK_DIR, workDirectory);
return create(workDirectory, includeSecondary);
} | [
"public",
"static",
"LocalAlluxioMaster",
"create",
"(",
"boolean",
"includeSecondary",
")",
"throws",
"IOException",
"{",
"String",
"workDirectory",
"=",
"uniquePath",
"(",
")",
";",
"FileUtils",
".",
"deletePathRecursively",
"(",
"workDirectory",
")",
";",
"Server... | Creates a new local Alluxio master with an isolated work directory and port.
@param includeSecondary whether to start a secondary master alongside the regular master
@return an instance of Alluxio master | [
"Creates",
"a",
"new",
"local",
"Alluxio",
"master",
"with",
"an",
"isolated",
"work",
"directory",
"and",
"port",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java#L75-L80 |
19,075 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java | LocalAlluxioMaster.create | public static LocalAlluxioMaster create(String workDirectory, boolean includeSecondary)
throws IOException {
if (!Files.isDirectory(Paths.get(workDirectory))) {
Files.createDirectory(Paths.get(workDirectory));
}
return new LocalAlluxioMaster(includeSecondary);
} | java | public static LocalAlluxioMaster create(String workDirectory, boolean includeSecondary)
throws IOException {
if (!Files.isDirectory(Paths.get(workDirectory))) {
Files.createDirectory(Paths.get(workDirectory));
}
return new LocalAlluxioMaster(includeSecondary);
} | [
"public",
"static",
"LocalAlluxioMaster",
"create",
"(",
"String",
"workDirectory",
",",
"boolean",
"includeSecondary",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"Files",
".",
"isDirectory",
"(",
"Paths",
".",
"get",
"(",
"workDirectory",
")",
")",
")... | Creates a new local Alluxio master with a isolated port.
@param workDirectory Alluxio work directory, this method will create it if it doesn't exist yet
@param includeSecondary whether to start a secondary master alongside the regular master
@return the created Alluxio master | [
"Creates",
"a",
"new",
"local",
"Alluxio",
"master",
"with",
"a",
"isolated",
"port",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java#L89-L95 |
19,076 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java | LocalAlluxioMaster.start | public void start() {
mMasterProcess = AlluxioMasterProcess.Factory.create();
Runnable runMaster = new Runnable() {
@Override
public void run() {
try {
LOG.info("Starting Alluxio master {}.", mMasterProcess);
mMasterProcess.start();
} catch (InterruptedException e... | java | public void start() {
mMasterProcess = AlluxioMasterProcess.Factory.create();
Runnable runMaster = new Runnable() {
@Override
public void run() {
try {
LOG.info("Starting Alluxio master {}.", mMasterProcess);
mMasterProcess.start();
} catch (InterruptedException e... | [
"public",
"void",
"start",
"(",
")",
"{",
"mMasterProcess",
"=",
"AlluxioMasterProcess",
".",
"Factory",
".",
"create",
"(",
")",
";",
"Runnable",
"runMaster",
"=",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{"... | Starts the master. | [
"Starts",
"the",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java#L100-L150 |
19,077 | Alluxio/alluxio | minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java | LocalAlluxioMaster.stop | public void stop() throws Exception {
if (mSecondaryMasterThread != null) {
mSecondaryMaster.stop();
while (mSecondaryMasterThread.isAlive()) {
LOG.info("Stopping thread {}.", mSecondaryMasterThread.getName());
mSecondaryMasterThread.join(1000);
}
mSecondaryMasterThread = nul... | java | public void stop() throws Exception {
if (mSecondaryMasterThread != null) {
mSecondaryMaster.stop();
while (mSecondaryMasterThread.isAlive()) {
LOG.info("Stopping thread {}.", mSecondaryMasterThread.getName());
mSecondaryMasterThread.join(1000);
}
mSecondaryMasterThread = nul... | [
"public",
"void",
"stop",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"mSecondaryMasterThread",
"!=",
"null",
")",
"{",
"mSecondaryMaster",
".",
"stop",
"(",
")",
";",
"while",
"(",
"mSecondaryMasterThread",
".",
"isAlive",
"(",
")",
")",
"{",
"LOG",
... | Stops the master processes and cleans up client connections. | [
"Stops",
"the",
"master",
"processes",
"and",
"cleans",
"up",
"client",
"connections",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/minicluster/src/main/java/alluxio/master/LocalAlluxioMaster.java#L162-L183 |
19,078 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java | FileSystemContext.init | private synchronized void init(MasterInquireClient masterInquireClient) {
mMasterInquireClient = masterInquireClient;
mFileSystemMasterClientPool =
new FileSystemMasterClientPool(mClientContext, mMasterInquireClient);
mBlockMasterClientPool = new BlockMasterClientPool(mClientContext, mMasterInquireC... | java | private synchronized void init(MasterInquireClient masterInquireClient) {
mMasterInquireClient = masterInquireClient;
mFileSystemMasterClientPool =
new FileSystemMasterClientPool(mClientContext, mMasterInquireClient);
mBlockMasterClientPool = new BlockMasterClientPool(mClientContext, mMasterInquireC... | [
"private",
"synchronized",
"void",
"init",
"(",
"MasterInquireClient",
"masterInquireClient",
")",
"{",
"mMasterInquireClient",
"=",
"masterInquireClient",
";",
"mFileSystemMasterClientPool",
"=",
"new",
"FileSystemMasterClientPool",
"(",
"mClientContext",
",",
"mMasterInquir... | Initializes the context. Only called in the factory methods.
@param masterInquireClient the client to use for determining the master | [
"Initializes",
"the",
"context",
".",
"Only",
"called",
"in",
"the",
"factory",
"methods",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java#L227-L260 |
19,079 | Alluxio/alluxio | core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java | FileSystemContext.releaseBlockWorkerClient | public void releaseBlockWorkerClient(WorkerNetAddress workerNetAddress,
BlockWorkerClient client) {
SocketAddress address = NetworkAddressUtils.getDataPortSocketAddress(workerNetAddress,
getClusterConf());
ClientPoolKey key = new ClientPoolKey(address, AuthenticationUserUtils.getImpersonationUser(... | java | public void releaseBlockWorkerClient(WorkerNetAddress workerNetAddress,
BlockWorkerClient client) {
SocketAddress address = NetworkAddressUtils.getDataPortSocketAddress(workerNetAddress,
getClusterConf());
ClientPoolKey key = new ClientPoolKey(address, AuthenticationUserUtils.getImpersonationUser(... | [
"public",
"void",
"releaseBlockWorkerClient",
"(",
"WorkerNetAddress",
"workerNetAddress",
",",
"BlockWorkerClient",
"client",
")",
"{",
"SocketAddress",
"address",
"=",
"NetworkAddressUtils",
".",
"getDataPortSocketAddress",
"(",
"workerNetAddress",
",",
"getClusterConf",
... | Releases a block worker client to the client pools.
@param workerNetAddress the address of the channel
@param client the client to release | [
"Releases",
"a",
"block",
"worker",
"client",
"to",
"the",
"client",
"pools",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/client/fs/src/main/java/alluxio/client/file/FileSystemContext.java#L424-L441 |
19,080 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalReader.java | UfsJournalReader.readInternal | private Journal.JournalEntry readInternal() throws IOException {
if (mInputStream == null) {
return null;
}
JournalEntry entry = mInputStream.mReader.readEntry();
if (entry != null) {
return entry;
}
if (mInputStream.mFile.isIncompleteLog()) {
// Incomplete logs may end early.
... | java | private Journal.JournalEntry readInternal() throws IOException {
if (mInputStream == null) {
return null;
}
JournalEntry entry = mInputStream.mReader.readEntry();
if (entry != null) {
return entry;
}
if (mInputStream.mFile.isIncompleteLog()) {
// Incomplete logs may end early.
... | [
"private",
"Journal",
".",
"JournalEntry",
"readInternal",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mInputStream",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"JournalEntry",
"entry",
"=",
"mInputStream",
".",
"mReader",
".",
"readEntry",
... | Reads the next journal entry.
@return the journal entry, null if no journal entry is found | [
"Reads",
"the",
"next",
"journal",
"entry",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalReader.java#L188-L205 |
19,081 | Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalReader.java | UfsJournalReader.updateInputStream | private void updateInputStream() throws IOException {
if (mInputStream != null && (mInputStream.mFile.isIncompleteLog() || !mInputStream.isDone())) {
return;
}
if (mInputStream != null) {
mInputStream.close();
mInputStream = null;
}
if (mFilesToProcess.isEmpty()) {
UfsJourna... | java | private void updateInputStream() throws IOException {
if (mInputStream != null && (mInputStream.mFile.isIncompleteLog() || !mInputStream.isDone())) {
return;
}
if (mInputStream != null) {
mInputStream.close();
mInputStream = null;
}
if (mFilesToProcess.isEmpty()) {
UfsJourna... | [
"private",
"void",
"updateInputStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mInputStream",
"!=",
"null",
"&&",
"(",
"mInputStream",
".",
"mFile",
".",
"isIncompleteLog",
"(",
")",
"||",
"!",
"mInputStream",
".",
"isDone",
"(",
")",
")",
")"... | Updates the journal input stream by closing the current journal input stream if it is done and
opening a new one. | [
"Updates",
"the",
"journal",
"input",
"stream",
"by",
"closing",
"the",
"current",
"journal",
"input",
"stream",
"if",
"it",
"is",
"done",
"and",
"opening",
"a",
"new",
"one",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalReader.java#L211-L257 |
19,082 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/report/SummaryCommand.java | SummaryCommand.printMetaMasterInfo | private void printMetaMasterInfo() throws IOException {
mIndentationLevel++;
Set<MasterInfoField> masterInfoFilter = new HashSet<>(Arrays
.asList(MasterInfoField.LEADER_MASTER_ADDRESS, MasterInfoField.WEB_PORT,
MasterInfoField.RPC_PORT, MasterInfoField.START_TIME_MS,
MasterInfoFi... | java | private void printMetaMasterInfo() throws IOException {
mIndentationLevel++;
Set<MasterInfoField> masterInfoFilter = new HashSet<>(Arrays
.asList(MasterInfoField.LEADER_MASTER_ADDRESS, MasterInfoField.WEB_PORT,
MasterInfoField.RPC_PORT, MasterInfoField.START_TIME_MS,
MasterInfoFi... | [
"private",
"void",
"printMetaMasterInfo",
"(",
")",
"throws",
"IOException",
"{",
"mIndentationLevel",
"++",
";",
"Set",
"<",
"MasterInfoField",
">",
"masterInfoFilter",
"=",
"new",
"HashSet",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"MasterInfoField",
".",
"LEA... | Prints Alluxio meta master information. | [
"Prints",
"Alluxio",
"meta",
"master",
"information",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/report/SummaryCommand.java#L78-L108 |
19,083 | Alluxio/alluxio | shell/src/main/java/alluxio/cli/fsadmin/report/SummaryCommand.java | SummaryCommand.printBlockMasterInfo | private void printBlockMasterInfo() throws IOException {
Set<BlockMasterInfoField> blockMasterInfoFilter = new HashSet<>(Arrays
.asList(BlockMasterInfoField.LIVE_WORKER_NUM, BlockMasterInfoField.LOST_WORKER_NUM,
BlockMasterInfoField.CAPACITY_BYTES, BlockMasterInfoField.USED_BYTES,
Bl... | java | private void printBlockMasterInfo() throws IOException {
Set<BlockMasterInfoField> blockMasterInfoFilter = new HashSet<>(Arrays
.asList(BlockMasterInfoField.LIVE_WORKER_NUM, BlockMasterInfoField.LOST_WORKER_NUM,
BlockMasterInfoField.CAPACITY_BYTES, BlockMasterInfoField.USED_BYTES,
Bl... | [
"private",
"void",
"printBlockMasterInfo",
"(",
")",
"throws",
"IOException",
"{",
"Set",
"<",
"BlockMasterInfoField",
">",
"blockMasterInfoFilter",
"=",
"new",
"HashSet",
"<>",
"(",
"Arrays",
".",
"asList",
"(",
"BlockMasterInfoField",
".",
"LIVE_WORKER_NUM",
",",
... | Prints Alluxio block master information. | [
"Prints",
"Alluxio",
"block",
"master",
"information",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/report/SummaryCommand.java#L113-L152 |
19,084 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/RetryHandlingMetaMasterMasterClient.java | RetryHandlingMetaMasterMasterClient.getId | public long getId(final Address address) throws IOException {
return retryRPC(() -> mClient
.getMasterId(GetMasterIdPRequest.newBuilder().setMasterAddress(address.toProto()).build())
.getMasterId());
} | java | public long getId(final Address address) throws IOException {
return retryRPC(() -> mClient
.getMasterId(GetMasterIdPRequest.newBuilder().setMasterAddress(address.toProto()).build())
.getMasterId());
} | [
"public",
"long",
"getId",
"(",
"final",
"Address",
"address",
")",
"throws",
"IOException",
"{",
"return",
"retryRPC",
"(",
"(",
")",
"->",
"mClient",
".",
"getMasterId",
"(",
"GetMasterIdPRequest",
".",
"newBuilder",
"(",
")",
".",
"setMasterAddress",
"(",
... | Returns a master id for a master address.
@param address the address to get a master id for
@return a master id | [
"Returns",
"a",
"master",
"id",
"for",
"a",
"master",
"address",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/RetryHandlingMetaMasterMasterClient.java#L75-L79 |
19,085 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/RetryHandlingMetaMasterMasterClient.java | RetryHandlingMetaMasterMasterClient.heartbeat | public MetaCommand heartbeat(final long masterId) throws IOException {
return retryRPC(() -> mClient
.masterHeartbeat(MasterHeartbeatPRequest.newBuilder().setMasterId(masterId).build())
.getCommand());
} | java | public MetaCommand heartbeat(final long masterId) throws IOException {
return retryRPC(() -> mClient
.masterHeartbeat(MasterHeartbeatPRequest.newBuilder().setMasterId(masterId).build())
.getCommand());
} | [
"public",
"MetaCommand",
"heartbeat",
"(",
"final",
"long",
"masterId",
")",
"throws",
"IOException",
"{",
"return",
"retryRPC",
"(",
"(",
")",
"->",
"mClient",
".",
"masterHeartbeat",
"(",
"MasterHeartbeatPRequest",
".",
"newBuilder",
"(",
")",
".",
"setMasterI... | Sends a heartbeat to the leader master. Standby masters periodically execute this method
so that the leader master knows they are still running.
@param masterId the master id
@return whether this master should re-register | [
"Sends",
"a",
"heartbeat",
"to",
"the",
"leader",
"master",
".",
"Standby",
"masters",
"periodically",
"execute",
"this",
"method",
"so",
"that",
"the",
"leader",
"master",
"knows",
"they",
"are",
"still",
"running",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/RetryHandlingMetaMasterMasterClient.java#L88-L92 |
19,086 | Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/meta/RetryHandlingMetaMasterMasterClient.java | RetryHandlingMetaMasterMasterClient.register | public void register(final long masterId, final List<ConfigProperty> configList)
throws IOException {
retryRPC(() -> {
mClient.registerMaster(RegisterMasterPRequest.newBuilder().setMasterId(masterId)
.setOptions(RegisterMasterPOptions.newBuilder().addAllConfigs(configList).build())
.... | java | public void register(final long masterId, final List<ConfigProperty> configList)
throws IOException {
retryRPC(() -> {
mClient.registerMaster(RegisterMasterPRequest.newBuilder().setMasterId(masterId)
.setOptions(RegisterMasterPOptions.newBuilder().addAllConfigs(configList).build())
.... | [
"public",
"void",
"register",
"(",
"final",
"long",
"masterId",
",",
"final",
"List",
"<",
"ConfigProperty",
">",
"configList",
")",
"throws",
"IOException",
"{",
"retryRPC",
"(",
"(",
")",
"->",
"{",
"mClient",
".",
"registerMaster",
"(",
"RegisterMasterPRequ... | Registers with the leader master.
@param masterId the master id of the standby master registering
@param configList the configuration of this master | [
"Registers",
"with",
"the",
"leader",
"master",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/meta/RetryHandlingMetaMasterMasterClient.java#L100-L108 |
19,087 | Alluxio/alluxio | core/common/src/main/java/alluxio/security/group/provider/ShellBasedUnixGroupsMapping.java | ShellBasedUnixGroupsMapping.getGroups | @Override
public List<String> getGroups(String user) throws IOException {
List<String> groups = CommonUtils.getUnixGroups(user);
// remove duplicated primary group
return new ArrayList<>(new LinkedHashSet<>(groups));
} | java | @Override
public List<String> getGroups(String user) throws IOException {
List<String> groups = CommonUtils.getUnixGroups(user);
// remove duplicated primary group
return new ArrayList<>(new LinkedHashSet<>(groups));
} | [
"@",
"Override",
"public",
"List",
"<",
"String",
">",
"getGroups",
"(",
"String",
"user",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"groups",
"=",
"CommonUtils",
".",
"getUnixGroups",
"(",
"user",
")",
";",
"// remove duplicated primary g... | Returns list of groups for a user.
@param user get groups for this user
@return list of groups for a given user | [
"Returns",
"list",
"of",
"groups",
"for",
"a",
"user",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/security/group/provider/ShellBasedUnixGroupsMapping.java#L39-L44 |
19,088 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/AlluxioWorkerRestServiceHandler.java | AlluxioWorkerRestServiceHandler.getWebUIOverview | @GET
@Path(WEBUI_OVERVIEW)
@ReturnType("alluxio.wire.WorkerWebUIOverview")
public Response getWebUIOverview() {
return RestUtils.call(() -> {
WorkerWebUIOverview response = new WorkerWebUIOverview();
response.setWorkerInfo(new UIWorkerInfo(mWorkerProcess.getRpcAddress().toString(),
mWor... | java | @GET
@Path(WEBUI_OVERVIEW)
@ReturnType("alluxio.wire.WorkerWebUIOverview")
public Response getWebUIOverview() {
return RestUtils.call(() -> {
WorkerWebUIOverview response = new WorkerWebUIOverview();
response.setWorkerInfo(new UIWorkerInfo(mWorkerProcess.getRpcAddress().toString(),
mWor... | [
"@",
"GET",
"@",
"Path",
"(",
"WEBUI_OVERVIEW",
")",
"@",
"ReturnType",
"(",
"\"alluxio.wire.WorkerWebUIOverview\"",
")",
"public",
"Response",
"getWebUIOverview",
"(",
")",
"{",
"return",
"RestUtils",
".",
"call",
"(",
"(",
")",
"->",
"{",
"WorkerWebUIOverview"... | Gets web ui overview page data.
@return the response object | [
"Gets",
"web",
"ui",
"overview",
"page",
"data",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/AlluxioWorkerRestServiceHandler.java#L208-L252 |
19,089 | Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/AlluxioWorkerRestServiceHandler.java | AlluxioWorkerRestServiceHandler.getWebUIMetrics | @GET
@Path(WEBUI_METRICS)
@ReturnType("alluxio.wire.WorkerWebUIMetrics")
public Response getWebUIMetrics() {
return RestUtils.call(() -> {
WorkerWebUIMetrics response = new WorkerWebUIMetrics();
MetricRegistry mr = MetricsSystem.METRIC_REGISTRY;
Long workerCapacityTotal = (Long) mr.getGaug... | java | @GET
@Path(WEBUI_METRICS)
@ReturnType("alluxio.wire.WorkerWebUIMetrics")
public Response getWebUIMetrics() {
return RestUtils.call(() -> {
WorkerWebUIMetrics response = new WorkerWebUIMetrics();
MetricRegistry mr = MetricsSystem.METRIC_REGISTRY;
Long workerCapacityTotal = (Long) mr.getGaug... | [
"@",
"GET",
"@",
"Path",
"(",
"WEBUI_METRICS",
")",
"@",
"ReturnType",
"(",
"\"alluxio.wire.WorkerWebUIMetrics\"",
")",
"public",
"Response",
"getWebUIMetrics",
"(",
")",
"{",
"return",
"RestUtils",
".",
"call",
"(",
"(",
")",
"->",
"{",
"WorkerWebUIMetrics",
... | Gets web ui metrics page data.
@return the response object | [
"Gets",
"web",
"ui",
"metrics",
"page",
"data",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/AlluxioWorkerRestServiceHandler.java#L372-L427 |
19,090 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/RuleFilterEvaluator.java | RuleFilterEvaluator.getSkipCorrectedReference | private int getSkipCorrectedReference(List<Integer> tokenPositions, int refNumber) {
int correctedRef = 0;
int i = 0;
for (int tokenPosition : tokenPositions) {
if (i++ >= refNumber) {
break;
}
correctedRef += tokenPosition;
}
return correctedRef - 1;
} | java | private int getSkipCorrectedReference(List<Integer> tokenPositions, int refNumber) {
int correctedRef = 0;
int i = 0;
for (int tokenPosition : tokenPositions) {
if (i++ >= refNumber) {
break;
}
correctedRef += tokenPosition;
}
return correctedRef - 1;
} | [
"private",
"int",
"getSkipCorrectedReference",
"(",
"List",
"<",
"Integer",
">",
"tokenPositions",
",",
"int",
"refNumber",
")",
"{",
"int",
"correctedRef",
"=",
"0",
";",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"int",
"tokenPosition",
":",
"tokenPositions",
... | when there's a 'skip', we need to adapt the reference number | [
"when",
"there",
"s",
"a",
"skip",
"we",
"need",
"to",
"adapt",
"the",
"reference",
"number"
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/RuleFilterEvaluator.java#L80-L90 |
19,091 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/RuleMatch.java | RuleMatch.compareTo | @Override
public int compareTo(RuleMatch other) {
Objects.requireNonNull(other);
return Integer.compare(getFromPos(), other.getFromPos());
} | java | @Override
public int compareTo(RuleMatch other) {
Objects.requireNonNull(other);
return Integer.compare(getFromPos(), other.getFromPos());
} | [
"@",
"Override",
"public",
"int",
"compareTo",
"(",
"RuleMatch",
"other",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"other",
")",
";",
"return",
"Integer",
".",
"compare",
"(",
"getFromPos",
"(",
")",
",",
"other",
".",
"getFromPos",
"(",
")",
")"... | Compare by start position. | [
"Compare",
"by",
"start",
"position",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/RuleMatch.java#L369-L373 |
19,092 | languagetool-org/languagetool | languagetool-language-modules/ca/src/main/java/org/languagetool/rules/ca/MorfologikCatalanSpellerRule.java | MorfologikCatalanSpellerRule.matchPostagRegexp | private boolean matchPostagRegexp(AnalyzedTokenReadings aToken, Pattern pattern) {
for (AnalyzedToken analyzedToken : aToken) {
String posTag = analyzedToken.getPOSTag();
if (posTag == null) {
posTag = "UNKNOWN";
}
final Matcher m = pattern.matcher(posTag);
if (m.matches... | java | private boolean matchPostagRegexp(AnalyzedTokenReadings aToken, Pattern pattern) {
for (AnalyzedToken analyzedToken : aToken) {
String posTag = analyzedToken.getPOSTag();
if (posTag == null) {
posTag = "UNKNOWN";
}
final Matcher m = pattern.matcher(posTag);
if (m.matches... | [
"private",
"boolean",
"matchPostagRegexp",
"(",
"AnalyzedTokenReadings",
"aToken",
",",
"Pattern",
"pattern",
")",
"{",
"for",
"(",
"AnalyzedToken",
"analyzedToken",
":",
"aToken",
")",
"{",
"String",
"posTag",
"=",
"analyzedToken",
".",
"getPOSTag",
"(",
")",
"... | Match POS tag with regular expression | [
"Match",
"POS",
"tag",
"with",
"regular",
"expression"
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-language-modules/ca/src/main/java/org/languagetool/rules/ca/MorfologikCatalanSpellerRule.java#L140-L152 |
19,093 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/Languages.java | Languages.getLanguageForName | @Nullable
public static Language getLanguageForName(String languageName) {
for (Language element : getStaticAndDynamicLanguages()) {
if (languageName.equals(element.getName())) {
return element;
}
}
return null;
} | java | @Nullable
public static Language getLanguageForName(String languageName) {
for (Language element : getStaticAndDynamicLanguages()) {
if (languageName.equals(element.getName())) {
return element;
}
}
return null;
} | [
"@",
"Nullable",
"public",
"static",
"Language",
"getLanguageForName",
"(",
"String",
"languageName",
")",
"{",
"for",
"(",
"Language",
"element",
":",
"getStaticAndDynamicLanguages",
"(",
")",
")",
"{",
"if",
"(",
"languageName",
".",
"equals",
"(",
"element",
... | Get the Language object for the given language name.
@param languageName e.g. <code>English</code> or <code>German</code> (case is significant)
@return a Language object or {@code null} if there is no such language | [
"Get",
"the",
"Language",
"object",
"for",
"the",
"given",
"language",
"name",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/Languages.java#L197-L205 |
19,094 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/Languages.java | Languages.getLanguageForShortCode | public static Language getLanguageForShortCode(String langCode, List<String> noopLanguageCodes) {
Language language = getLanguageForShortCodeOrNull(langCode);
if (language == null) {
if (noopLanguageCodes.contains(langCode)) {
return NOOP_LANGUAGE;
} else {
List<String> codes = new A... | java | public static Language getLanguageForShortCode(String langCode, List<String> noopLanguageCodes) {
Language language = getLanguageForShortCodeOrNull(langCode);
if (language == null) {
if (noopLanguageCodes.contains(langCode)) {
return NOOP_LANGUAGE;
} else {
List<String> codes = new A... | [
"public",
"static",
"Language",
"getLanguageForShortCode",
"(",
"String",
"langCode",
",",
"List",
"<",
"String",
">",
"noopLanguageCodes",
")",
"{",
"Language",
"language",
"=",
"getLanguageForShortCodeOrNull",
"(",
"langCode",
")",
";",
"if",
"(",
"language",
"=... | Get the Language object for the given language code.
@param langCode e.g. <code>en</code> or <code>en-US</code>
@param noopLanguageCodes list of languages that can be detected but that will not actually find any errors
(can be used so non-supported languages are not detected as some other language)
@throws IllegalArgum... | [
"Get",
"the",
"Language",
"object",
"for",
"the",
"given",
"language",
"code",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/Languages.java#L225-L242 |
19,095 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java | Unifier.isSatisfied | protected final boolean isSatisfied(AnalyzedToken aToken,
Map<String, List<String>> uFeatures) {
if (allFeatsIn && equivalencesMatched.isEmpty()) {
return false;
}
if (uFeatures == null) {
throw new RuntimeException("isSatisfied called without features being set");
}
unificationFe... | java | protected final boolean isSatisfied(AnalyzedToken aToken,
Map<String, List<String>> uFeatures) {
if (allFeatsIn && equivalencesMatched.isEmpty()) {
return false;
}
if (uFeatures == null) {
throw new RuntimeException("isSatisfied called without features being set");
}
unificationFe... | [
"protected",
"final",
"boolean",
"isSatisfied",
"(",
"AnalyzedToken",
"aToken",
",",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"uFeatures",
")",
"{",
"if",
"(",
"allFeatsIn",
"&&",
"equivalencesMatched",
".",
"isEmpty",
"(",
")",
")",
"{"... | Tests if a token has shared features with other tokens.
@param aToken token to be tested
@param uFeatures features to be tested
@return true if the token shares this type of feature with other tokens | [
"Tests",
"if",
"a",
"token",
"has",
"shared",
"features",
"with",
"other",
"tokens",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java#L107-L166 |
19,096 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java | Unifier.startUnify | public final void startUnify() {
allFeatsIn = true;
for (int i = 0; i < tokCnt; i++) {
featuresFound.add(false);
}
tmpFeaturesFound = new ArrayList<>(featuresFound);
} | java | public final void startUnify() {
allFeatsIn = true;
for (int i = 0; i < tokCnt; i++) {
featuresFound.add(false);
}
tmpFeaturesFound = new ArrayList<>(featuresFound);
} | [
"public",
"final",
"void",
"startUnify",
"(",
")",
"{",
"allFeatsIn",
"=",
"true",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"tokCnt",
";",
"i",
"++",
")",
"{",
"featuresFound",
".",
"add",
"(",
"false",
")",
";",
"}",
"tmpFeaturesFound... | Starts testing only those equivalences that were previously matched. | [
"Starts",
"testing",
"only",
"those",
"equivalences",
"that",
"were",
"previously",
"matched",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java#L262-L268 |
19,097 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java | Unifier.getFinalUnificationValue | public final boolean getFinalUnificationValue(Map<String, List<String>> uFeatures) {
int tokUnified = 0;
for (int j = 0; j < tokSequence.size(); j++) {
boolean unifiedTokensFound = false; // assume that nothing has been found
for (int i = 0; i < tokSequenceEquivalences.get(j).size(); i++) {
... | java | public final boolean getFinalUnificationValue(Map<String, List<String>> uFeatures) {
int tokUnified = 0;
for (int j = 0; j < tokSequence.size(); j++) {
boolean unifiedTokensFound = false; // assume that nothing has been found
for (int i = 0; i < tokSequenceEquivalences.get(j).size(); i++) {
... | [
"public",
"final",
"boolean",
"getFinalUnificationValue",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"uFeatures",
")",
"{",
"int",
"tokUnified",
"=",
"0",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"tokSequence",
".",
... | Make sure that we really matched all the required features of the unification.
@param uFeatures Features to be checked
@return True if the token sequence has been found.
@since 2.5 | [
"Make",
"sure",
"that",
"we",
"really",
"matched",
"all",
"the",
"required",
"features",
"of",
"the",
"unification",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java#L276-L313 |
19,098 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java | Unifier.reset | public final void reset() {
equivalencesMatched.clear();
allFeatsIn = false;
tokCnt = 0;
featuresFound.clear();
tmpFeaturesFound.clear();
tokSequence.clear();
tokSequenceEquivalences.clear();
readingsCounter = 1;
uniMatched = false;
uniAllMatched = false;
inUnification = fals... | java | public final void reset() {
equivalencesMatched.clear();
allFeatsIn = false;
tokCnt = 0;
featuresFound.clear();
tmpFeaturesFound.clear();
tokSequence.clear();
tokSequenceEquivalences.clear();
readingsCounter = 1;
uniMatched = false;
uniAllMatched = false;
inUnification = fals... | [
"public",
"final",
"void",
"reset",
"(",
")",
"{",
"equivalencesMatched",
".",
"clear",
"(",
")",
";",
"allFeatsIn",
"=",
"false",
";",
"tokCnt",
"=",
"0",
";",
"featuresFound",
".",
"clear",
"(",
")",
";",
"tmpFeaturesFound",
".",
"clear",
"(",
")",
"... | Resets after use of unification. Required. | [
"Resets",
"after",
"use",
"of",
"unification",
".",
"Required",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java#L318-L330 |
19,099 | languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java | Unifier.getUnifiedTokens | @Nullable
public final AnalyzedTokenReadings[] getUnifiedTokens() {
if (tokSequence.isEmpty()) {
return null;
}
List<AnalyzedTokenReadings> uTokens = new ArrayList<>();
for (int j = 0; j < tokSequence.size(); j++) {
boolean unifiedTokensFound = false; // assume that nothing has been found
... | java | @Nullable
public final AnalyzedTokenReadings[] getUnifiedTokens() {
if (tokSequence.isEmpty()) {
return null;
}
List<AnalyzedTokenReadings> uTokens = new ArrayList<>();
for (int j = 0; j < tokSequence.size(); j++) {
boolean unifiedTokensFound = false; // assume that nothing has been found
... | [
"@",
"Nullable",
"public",
"final",
"AnalyzedTokenReadings",
"[",
"]",
"getUnifiedTokens",
"(",
")",
"{",
"if",
"(",
"tokSequence",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"List",
"<",
"AnalyzedTokenReadings",
">",
"uTokens",
"=",
"... | Gets a full sequence of filtered tokens.
@return Array of AnalyzedTokenReadings that match equivalence relation
defined for features tested, or {@code null} | [
"Gets",
"a",
"full",
"sequence",
"of",
"filtered",
"tokens",
"."
] | b7a3d63883d242fb2525877c6382681c57a0a142 | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/Unifier.java#L337-L370 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.