public class PackageUtils extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BLACK |
static String |
BLUE |
static String |
CLUSTER_PLUGINS_PATH |
static String |
CLUSTERPROPS_PATH |
static String |
CYAN |
static String |
GREEN |
static String |
LATEST
Represents a version which denotes the latest version available at the moment.
|
static String |
PACKAGE_PATH |
static String |
PURPLE |
static String |
RED |
static String |
REPOSITORIES_ZK_PATH |
static String |
WHITE |
static String |
YELLOW |
Constructor and Description |
---|
PackageUtils() |
Modifier and Type | Method and Description |
---|---|
static boolean |
checkVersionConstraint(String ver,
String constraint)
Checks whether a given version satisfies the constraint (defined by a semver expression)
|
static int |
compareVersions(String v1,
String v2)
Compares two versions v1 and v2.
|
static SolrPackage.Manifest |
fetchManifest(HttpSolrClient solrClient,
String solrBaseUrl,
String manifestFilePath,
String expectedSHA512)
Fetches a manifest file from the File Store / Package Store.
|
static String |
getCollectionParamsPath(String collection) |
static String |
getFileFromJarsAsString(List<Path> jars,
String filename)
Search through the list of jar files for a given file.
|
static <T> T |
getJson(org.apache.http.client.HttpClient client,
String url,
Class<T> klass)
Download JSON from the url and deserialize into klass.
|
static String |
getJsonStringFromUrl(org.apache.http.client.HttpClient client,
String url)
Returns JSON string from a given URL
|
static com.fasterxml.jackson.databind.ObjectMapper |
getMapper() |
static com.jayway.jsonpath.Configuration |
jsonPathConfiguration() |
static Map |
map(Object... params)
Replacement for Java 11's Map.of().
|
static void |
postFile(SolrClient client,
ByteBuffer buffer,
String name,
String sig)
Uploads a file to the package store / file store of Solr.
|
static void |
print(Object message) |
static void |
print(String color,
Object message) |
static void |
printGreen(Object message)
Console print using green color
|
static void |
printRed(Object message)
Console print using red color
|
static String |
resolve(String str,
Map<String,String> defaults,
Map<String,String> overrides,
Map<String,String> systemParams)
Replace a templatized string with parameter substituted string.
|
static void |
uploadKey(byte[] bytes,
String path,
Path home,
HttpSolrClient client) |
static String[] |
validateCollections(String[] collections) |
public static String LATEST
public static String PACKAGE_PATH
public static String CLUSTER_PLUGINS_PATH
public static String REPOSITORIES_ZK_PATH
public static String CLUSTERPROPS_PATH
public static String BLACK
public static String RED
public static String GREEN
public static String YELLOW
public static String BLUE
public static String PURPLE
public static String CYAN
public static String WHITE
public static com.jayway.jsonpath.Configuration jsonPathConfiguration()
public static com.fasterxml.jackson.databind.ObjectMapper getMapper()
public static void postFile(SolrClient client, ByteBuffer buffer, String name, String sig) throws SolrServerException, IOException
client
- A Solr clientbuffer
- File contentsname
- Name of the file as it will appear in the file store (can be hierarchical)sig
- Signature digest (public key should be separately uploaded to ZK)SolrServerException
IOException
public static <T> T getJson(org.apache.http.client.HttpClient client, String url, Class<T> klass)
public static String getFileFromJarsAsString(List<Path> jars, String filename)
public static String getJsonStringFromUrl(org.apache.http.client.HttpClient client, String url)
public static boolean checkVersionConstraint(String ver, String constraint)
public static SolrPackage.Manifest fetchManifest(HttpSolrClient solrClient, String solrBaseUrl, String manifestFilePath, String expectedSHA512) throws MalformedURLException, IOException
MalformedURLException
IOException
public static String resolve(String str, Map<String,String> defaults, Map<String,String> overrides, Map<String,String> systemParams)
public static int compareVersions(String v1, String v2)
public static void printGreen(Object message)
public static void printRed(Object message)
public static void print(Object message)
public static Map map(Object... params)
public static void uploadKey(byte[] bytes, String path, Path home, HttpSolrClient client) throws IOException
IOException
Copyright © 2000-2021 Apache Software Foundation. All Rights Reserved.