Package org.apache.hadoop.yarn.util
Class StringHelper
java.lang.Object
org.apache.hadoop.yarn.util.StringHelper
Common string manipulation helpers
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Splitterstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Joinerstatic final org.apache.hadoop.thirdparty.com.google.common.base.Splitter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringJoin on underscore.Split on _ and trim results.static StringJoin on comma.static StringJoin on dot.static StringgetResourceSecondsString(Map<String, Long> targetMap) static booleanisAbsUrl(CharSequence url) Check whether a url is absolute or note.static StringJoin without separator.static StringJoin with a separatorstatic StringJoin on slash and colon (e.g., path args in routing spec)static StringJoin on slash.static StringJoin on space.Split on space and trim results.static StringJoin url components.
-
Field Details
-
SSV_JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner SSV_JOINER -
CSV_JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner CSV_JOINER -
JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner JOINER -
_JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner _JOINER -
PATH_JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner PATH_JOINER -
PATH_ARG_JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner PATH_ARG_JOINER -
DOT_JOINER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Joiner DOT_JOINER -
SSV_SPLITTER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Splitter SSV_SPLITTER -
_SPLITTER
public static final org.apache.hadoop.thirdparty.com.google.common.base.Splitter _SPLITTER
-
-
Constructor Details
-
StringHelper
public StringHelper()
-
-
Method Details
-
sjoin
Join on space.- Parameters:
args- to join- Returns:
- args joined by space
-
cjoin
Join on comma.- Parameters:
args- to join- Returns:
- args joined by comma
-
djoin
Join on dot.- Parameters:
args- to join- Returns:
- args joined by dot
-
_join
Join on underscore.- Parameters:
args- to join- Returns:
- args joined underscore
-
pjoin
Join on slash.- Parameters:
args- to join- Returns:
- args joined with slash
-
pajoin
Join on slash and colon (e.g., path args in routing spec)- Parameters:
args- to join- Returns:
- args joined with /:
-
join
Join without separator.- Parameters:
args- to join.- Returns:
- joined args with no separator
-
joins
Join with a separator- Parameters:
sep- the separatorargs- to join- Returns:
- args joined with a separator
-
split
Split on space and trim results.- Parameters:
s- the string to split- Returns:
- an iterable of strings
-
_split
Split on _ and trim results.- Parameters:
s- the string to split- Returns:
- an iterable of strings
-
isAbsUrl
Check whether a url is absolute or note.- Parameters:
url- to check- Returns:
- true if url starts with scheme:// or //
-
ujoin
Join url components.- Parameters:
pathPrefix- for relative urlsargs- url components to join- Returns:
- an url string
-
getResourceSecondsString
-