Skip to content

Commit

Permalink
Merge branch 'main' into 4.0-feature-4905
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinrr888 committed Dec 10, 2024
2 parents 29edaa2 + 6407c31 commit 21e34af
Show file tree
Hide file tree
Showing 124 changed files with 2,940 additions and 3,351 deletions.
782 changes: 290 additions & 492 deletions assemble/bin/accumulo-cluster

Large diffs are not rendered by default.

20 changes: 3 additions & 17 deletions assemble/bin/accumulo-service
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,6 @@ function get_group() {
echo "${group}"
}

function get_group_overrides() {
service="$1"
group="$2"
if [[ -f "${conf}/${group}-group-env.sh" ]]; then
#shellcheck source=../conf/default-group-env.sh
source "${conf}/${group}-group-env.sh" "${service}"
fi
}

function start_service() {
local service_type=$1
local service_name=$2
Expand All @@ -93,14 +84,6 @@ function start_service() {
servers_per_host=${ACCUMULO_CLUSTER_ARG:-1}
fi

group=$(get_group "$@")

#
# Get any resource group overrides, this should
# export ACCUMULO_JAVA_OPTS and PROPERTY_OVERRIDES
#
get_group_overrides "$service_type" "$group"

for ((process_num = 1; process_num <= servers_per_host; process_num++)); do
if [[ ${build_service_name} == "true" ]]; then
service_name="${service_type}_${group}_${process_num}"
Expand Down Expand Up @@ -253,6 +236,9 @@ function main() {
export conf="${ACCUMULO_CONF_DIR:-${basedir}/conf}"
export lib="${basedir}/lib"

group=$(get_group "$@")
export ACCUMULO_RESOURCE_GROUP="$group"

if [[ -f "${conf}/accumulo-env.sh" ]]; then
#shellcheck source=../conf/accumulo-env.sh
source "${conf}/accumulo-env.sh"
Expand Down
26 changes: 18 additions & 8 deletions assemble/conf/accumulo-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,24 @@ JAVA_OPTS=(
## JVM options set for individual applications
# cmd is set by calling script that sources this env file
#shellcheck disable=SC2154
case "$cmd" in
manager) JAVA_OPTS=('-Xmx512m' '-Xms512m' "${JAVA_OPTS[@]}") ;;
monitor) JAVA_OPTS=('-Xmx256m' '-Xms256m' "${JAVA_OPTS[@]}") ;;
gc) JAVA_OPTS=('-Xmx256m' '-Xms256m' "${JAVA_OPTS[@]}") ;;
tserver) JAVA_OPTS=('-Xmx768m' '-Xms768m' "${JAVA_OPTS[@]}") ;;
compactor) JAVA_OPTS=('-Xmx256m' '-Xms256m' "${JAVA_OPTS[@]}") ;;
sserver) JAVA_OPTS=('-Xmx512m' '-Xms512m' "${JAVA_OPTS[@]}") ;;
*) JAVA_OPTS=('-Xmx256m' '-Xms64m' "${JAVA_OPTS[@]}") ;;
case "${ACCUMULO_RESOURCE_GROUP:-default}" in
default)
# shellcheck disable=SC2154
# $cmd is exported in the accumulo script, but not the accumulo-service script
case "$cmd" in
manager) JAVA_OPTS=('-Xmx512m' '-Xms512m' "${JAVA_OPTS[@]}") ;;
monitor) JAVA_OPTS=('-Xmx256m' '-Xms256m' "${JAVA_OPTS[@]}") ;;
gc) JAVA_OPTS=('-Xmx256m' '-Xms256m' "${JAVA_OPTS[@]}") ;;
tserver) JAVA_OPTS=('-Xmx768m' '-Xms768m' "${JAVA_OPTS[@]}") ;;
compactor) JAVA_OPTS=('-Xmx256m' '-Xms256m' "${JAVA_OPTS[@]}") ;;
sserver) JAVA_OPTS=('-Xmx512m' '-Xms512m' "${JAVA_OPTS[@]}") ;;
*) JAVA_OPTS=('-Xmx256m' '-Xms64m' "${JAVA_OPTS[@]}") ;;
esac
;;
*)
echo "ACCUMULO_RESOURCE_GROUP named $ACCUMULO_RESOURCE_GROUP is not configured"
exit 1
;;
esac

## JVM options set for logging. Review log4j2.properties file to see how they are used.
Expand Down
5 changes: 5 additions & 0 deletions assemble/conf/accumulo.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,8 @@ instance.secret=DEFAULT

## Set to false if 'accumulo-util build-native' fails
tserver.memory.maps.native.enabled=true

## (optional) include additional property files for a resource group
## based on the ACCUMULO_RESOURCE_GROUP env var set in accumulo-service
#include=group-${env:ACCUMULO_RESOURCE_GROUP}.properties
#includeOptional=group-${env:ACCUMULO_RESOURCE_GROUP}.properties
80 changes: 0 additions & 80 deletions assemble/conf/default-group-env.sh

This file was deleted.

2 changes: 0 additions & 2 deletions core/src/main/java/org/apache/accumulo/core/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ public class Constants {
public static final String ZDEAD = "/dead";
public static final String ZDEADTSERVERS = ZDEAD + "/tservers";

public static final String ZPROBLEMS = "/problems";

public static final String ZFATE = "/fate";

public static final String ZNEXT_FILE = "/next_file";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,9 @@ public enum CompactionReason {
public abstract List<IteratorSetting> getIterators();

/**
* Return the host where the compaction is running.
* Return the server where the compaction is running.
*
* @since 2.1.0
* @since 4.0.0
*/
public abstract ServerId getHost();
public abstract ServerId getServerId();
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import java.util.List;
import java.util.Map;

import org.apache.accumulo.core.client.admin.servers.ServerId;
import org.apache.accumulo.core.data.Column;
import org.apache.accumulo.core.data.TabletId;
import org.apache.accumulo.core.security.Authorizations;
Expand Down Expand Up @@ -96,4 +97,11 @@ public abstract class ActiveScan {
* @since 1.5.0
*/
public abstract long getIdleTime();

/**
* Return the server where the scan is running.
*
* @since 4.0.0
*/
public abstract ServerId getServerId();
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,22 +259,22 @@ Set<ServerId> getServers(ServerId.Type type, Predicate<String> resourceGroupPred
* @param tserver The tablet server address. This should be of the form
* {@code <ip address>:<port>}
* @return A list of active scans on tablet server.
* @deprecated see {@link #getActiveScans(ServerId)}
* @deprecated see {@link #getActiveScans(Collection)}
*/
@Deprecated(since = "4.0.0")
List<ActiveScan> getActiveScans(String tserver)
throws AccumuloException, AccumuloSecurityException;

/**
* List the active scans on a server.
* List the active scans on a collection of servers.
*
* @param server server type and address
* @return A stream of active scans on server.
* @param servers Collection of server types and addresses
* @return A list of active scans on the given servers.
* @throws IllegalArgumentException when the type of the server is not TABLET_SERVER or
* SCAN_SERVER
* @since 4.0.0
*/
List<ActiveScan> getActiveScans(ServerId server)
List<ActiveScan> getActiveScans(Collection<ServerId> servers)
throws AccumuloException, AccumuloSecurityException;

/**
Expand All @@ -286,32 +286,20 @@ List<ActiveScan> getActiveScans(ServerId server)
* @param tserver The server address. This should be of the form {@code <ip address>:<port>}
* @return the list of active compactions
* @since 1.5.0
* @deprecated see {@link #getActiveCompactions(ServerId server)}
* @deprecated see {@link #getActiveCompactions(Collection)}
*/
@Deprecated(since = "4.0.0")
List<ActiveCompaction> getActiveCompactions(String tserver)
throws AccumuloException, AccumuloSecurityException;

/**
* List the active compaction running on a TabletServer or Compactor. The server address can be
* retrieved using {@link #getCompactors()} or {@link #getTabletServers()}. Use
* {@link #getActiveCompactions()} to get a list of all compactions running on tservers and
* compactors.
*
* @param server The ServerId object
* @return the list of active compactions
* @throws IllegalArgumentException when the type of the server is not TABLET_SERVER or COMPACTOR
* @since 4.0.0
*/
List<ActiveCompaction> getActiveCompactions(ServerId server)
throws AccumuloException, AccumuloSecurityException;

/**
* List all internal and external compactions running in Accumulo.
*
* @return the list of active compactions
* @since 2.1.0
* @deprecated see {@link #getActiveCompactions(Collection)}
*/
@Deprecated(since = "4.0.0")
List<ActiveCompaction> getActiveCompactions() throws AccumuloException, AccumuloSecurityException;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public List<IteratorSetting> getIterators() {
}

@Override
public ServerId getHost() {
public ServerId getServerId() {
return server;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.Objects;

import org.apache.accumulo.core.client.TableNotFoundException;
import org.apache.accumulo.core.client.admin.ActiveScan;
import org.apache.accumulo.core.client.admin.ScanState;
import org.apache.accumulo.core.client.admin.ScanType;
import org.apache.accumulo.core.client.admin.servers.ServerId;
import org.apache.accumulo.core.data.Column;
import org.apache.accumulo.core.data.TableId;
import org.apache.accumulo.core.data.TabletId;
Expand All @@ -44,20 +46,21 @@ public class ActiveScanImpl extends ActiveScan {

private final long scanId;
private final String client;
private String tableName;
private final String tableName;
private final long age;
private final long idle;
private ScanType type;
private ScanState state;
private KeyExtent extent;
private List<Column> columns;
private List<String> ssiList;
private Map<String,Map<String,String>> ssio;
private final ScanType type;
private final ScanState state;
private final KeyExtent extent;
private final List<Column> columns;
private final List<String> ssiList;
private final Map<String,Map<String,String>> ssio;
private final String user;
private Authorizations authorizations;
private final Authorizations authorizations;
private final ServerId server;

ActiveScanImpl(ClientContext context,
org.apache.accumulo.core.tabletscan.thrift.ActiveScan activeScan)
org.apache.accumulo.core.tabletscan.thrift.ActiveScan activeScan, ServerId server)
throws TableNotFoundException {
this.scanId = activeScan.scanId;
this.client = activeScan.client;
Expand All @@ -81,6 +84,7 @@ public class ActiveScanImpl extends ActiveScan {
this.ssiList.add(ii.iterName + "=" + ii.priority + "," + ii.className);
}
this.ssio = activeScan.ssio;
this.server = Objects.requireNonNull(server);
}

@Override
Expand Down Expand Up @@ -152,4 +156,9 @@ public Authorizations getAuthorizations() {
public long getIdleTime() {
return idle;
}

@Override
public ServerId getServerId() {
return server;
}
}
Loading

0 comments on commit 21e34af

Please sign in to comment.