public class NetricsTable
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
FLDTYP_ATTRS
Name/Value attributes value field.
|
static int |
FLDTYP_DATE
Date value field.
|
static int |
FLDTYP_DATETIME
Date and time value field.
|
static int |
FLDTYP_FLOAT
Floating point value field.
|
static int |
FLDTYP_INT
Integer value field.
|
static int |
FLDTYP_SRCHTEXT
Searchable text field.
|
static int |
FLDTYP_TEXT
Non-searchable text field.
|
Constructor and Description |
---|
NetricsTable(java.lang.String name,
java.lang.String[] fieldNames,
NetricsRecSrc src) |
Modifier and Type | Method and Description |
---|---|
void |
addPIndex(java.lang.String field_name,
boolean primary,
java.lang.String[] partition_separators,
boolean normalized)
Add a partition index to this table.
|
java.lang.String |
compare(NetricsTable tbl)
For internal use only.
|
java.lang.String[] |
getFieldNames()
Can be used to get the field names from a NetricsTable returned by a tbldump.
|
java.lang.String |
getInfo()
Can be used to get the table info from a NetricsTable returned by a tbldump.
|
java.lang.String |
getName()
Return the name of this table.
|
NetricsRecSrc |
getRecSrc()
Retrieve the NetricsRecSrc for a NetricsTable returned by a tbldump.
|
java.lang.String |
getString()
An unformatted string representation of the table.
|
void |
setCharmaps(java.lang.String[] charmaps)
Specifies the character map to use for each field.
|
void |
setEstNumRecords(int est_num)
Set the estimated number of records.
|
void |
setFieldTypes(int[] ftypes)
Specify the field types for this table.
|
void |
setGipFiltered(boolean enabled)
Enable gip filtering for this table.
|
void |
setGipGramLen(int glen)
This method sets the gram length for the enterprise filter.
|
void |
setInfo(java.lang.String info)
Set the table info string.
|
void |
setPhonetic(boolean enabled)
Enable phonetic searches for this table.
|
void |
setPsiEncodings(java.lang.String[][] encodings,
int[][] backwards_fields,
int[] suffixed_fields,
int[][] min_match_sizes)
Use this function to specify encodings for the PSI prefilter.
|
void |
setSortEncodings(java.lang.String[][] encodings,
int[][] backwards_fields)
Use this function to specify encodings for the SORT prefilter.
|
public static final int FLDTYP_TEXT
public static final int FLDTYP_SRCHTEXT
public static final int FLDTYP_INT
public static final int FLDTYP_FLOAT
public static final int FLDTYP_DATE
public static final int FLDTYP_DATETIME
public static final int FLDTYP_ATTRS
public NetricsTable(java.lang.String name, java.lang.String[] fieldNames, NetricsRecSrc src)
name
- The name of the table. Must be unique. In other commands,
the table will be referred to by this namefieldNames
- User specified names for the fields of
the table. In other commands, fields will be referred to by
these namessrc
- The NetricsRecSrc object which holds the records for this table (can be null to load an empty table)public java.lang.String getString()
public NetricsRecSrc getRecSrc()
public java.lang.String getName()
public void setEstNumRecords(int est_num)
public void setGipGramLen(int glen)
public void setInfo(java.lang.String info)
public java.lang.String getInfo()
public void setFieldTypes(int[] ftypes)
Field Type | Description |
NetricsTable.FLDTYP_TEXT | Non-searchable text |
NetricsTable.FLDTYP_SRCHTEXT | Searchable text |
NetricsTable.FLDTYP_INT | Integer type field |
NetricsTable.FLDTYP_FLOAT | Float type field |
NetricsTable.FLDTYP_DATE | Date type field (default format: yyyy/mm/dd) |
NetricsTable.FLDTYP_DATETIME | Date type field, with time (default format: yyyy/mm/dd HH:MM:SS) |
NetricsTable.FLDTYP_ATTRS | Name/Value attributes type field |
public void setGipFiltered(boolean enabled)
public void setSortEncodings(java.lang.String[][] encodings, int[][] backwards_fields) throws NetricsException
encodings
- Each string array is a list of field names which will
be used for a given sort encoding. The first field name will be the
primary sort key, the second field will be secondary, and so on. In
general, you should have as many encodings as the number of fields
in the table and use all important fields as the primary sort key
in at least one encoding.backwards_fields
- Fields can also be sorted backwards (from
the last characters in the field to the first). Important fields can
and should be used as primary sort keys in both their forward and
reverse directions. The backwards_fields array should be the same
length as the encodings array and the subarray at each position
in the two primary arrays should also be the same length. In this way,
there is an integer in the backwards_fields arrays for each of the
fields in the encodings arrays. The integer is set to 1 if the field
is to be sorted in the backwards direction and zero for the forward
direction.NetricsException
public void setPsiEncodings(java.lang.String[][] encodings, int[][] backwards_fields, int[] suffixed_fields, int[][] min_match_sizes) throws NetricsException
encodings
- Each string array is a list of field names which will
be used for a given PSI encoding. The first field name will be the
primary PSI key, the second field will be secondary, and so on. In
general, you should have as many encodings as the number of fields
in the table and use all important fields as the primary PSI key
in at least one encoding.backwards_fields
- Fields can also be sorted backwards (from
the last characters in the field to the first). Important fields can
and should be used as primary PSI keys in both their forward and
reverse directions. The backwards_fields array should be the same
length as the encodings array and the subarray at each position
in the two primary arrays should also be the same length. In this way,
there is an integer in the backwards_fields arrays for each of the
fields in the encodings arrays. The integer is set to 1 if the field
is to be sorted in the backwards direction and one for the forward
direction.suffixed_fields
- Indicates the number of fields in each encoding
to which suffixing is applied. Currently PSI only supports suffixing
the first field, so the entries of this array must be 0 or 1.min_match_sizes
- Indicates the minimum match size for each field
of each encoding. Match sizes are in characters for text fields, and
in bytes for non-text fields. A candidate record is rejected if none
of the minima are met. Like backwards_fields this array must have the
same dimensions as encodings.NetricsException
public void addPIndex(java.lang.String field_name, boolean primary, java.lang.String[] partition_separators, boolean normalized)
field_name
- The name of the field that is to be indexed.primary
- If true this is a primary index, otherwise it is a
secondary index.partition_separators
- This is an array that defines the upper
bound of each partition. The values MUST
be in sorted order (as per the type of the named field)
least to greatest. The size of the array defines the
number of partitions.normalized
- If true and the field is a string value the
normalized values are indexed. Thus this index
will work with the case insensitive comparison
operators and not work with the standard operators.NetricsPredicate
,
NetricsSearchCfg.SetSearchPredicate(com.netrics.likeit.NetricsPredicate)
public void setPhonetic(boolean enabled)
public java.lang.String[] getFieldNames()
public void setCharmaps(java.lang.String[] charmaps) throws NetricsException
charmaps
- A string name of the character map to use for each field in the table.NetricsException
NetricsCharmap
,
NetricsServerInterface.cmapcreate(com.netrics.likeit.NetricsCharmap)
public java.lang.String compare(NetricsTable tbl)