code
stringlengths 73
34.1k
| label
stringclasses 1
value |
---|---|
public static sslservicegroup_sslcipher_binding[] get(nitro_service service, String servicegroupname) throws Exception{
sslservicegroup_sslcipher_binding obj = new sslservicegroup_sslcipher_binding();
obj.set_servicegroupname(servicegroupname);
sslservicegroup_sslcipher_binding response[] = (sslservicegroup_sslcipher_binding[]) obj.get_resources(service);
return response;
} | java |
public static base_response add(nitro_service client, tmsessionaction resource) throws Exception {
tmsessionaction addresource = new tmsessionaction();
addresource.name = resource.name;
addresource.sesstimeout = resource.sesstimeout;
addresource.defaultauthorizationaction = resource.defaultauthorizationaction;
addresource.sso = resource.sso;
addresource.ssocredential = resource.ssocredential;
addresource.ssodomain = resource.ssodomain;
addresource.httponlycookie = resource.httponlycookie;
addresource.kcdaccount = resource.kcdaccount;
addresource.persistentcookie = resource.persistentcookie;
addresource.persistentcookievalidity = resource.persistentcookievalidity;
addresource.homepage = resource.homepage;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, tmsessionaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
tmsessionaction addresources[] = new tmsessionaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new tmsessionaction();
addresources[i].name = resources[i].name;
addresources[i].sesstimeout = resources[i].sesstimeout;
addresources[i].defaultauthorizationaction = resources[i].defaultauthorizationaction;
addresources[i].sso = resources[i].sso;
addresources[i].ssocredential = resources[i].ssocredential;
addresources[i].ssodomain = resources[i].ssodomain;
addresources[i].httponlycookie = resources[i].httponlycookie;
addresources[i].kcdaccount = resources[i].kcdaccount;
addresources[i].persistentcookie = resources[i].persistentcookie;
addresources[i].persistentcookievalidity = resources[i].persistentcookievalidity;
addresources[i].homepage = resources[i].homepage;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response update(nitro_service client, tmsessionaction resource) throws Exception {
tmsessionaction updateresource = new tmsessionaction();
updateresource.name = resource.name;
updateresource.sesstimeout = resource.sesstimeout;
updateresource.defaultauthorizationaction = resource.defaultauthorizationaction;
updateresource.sso = resource.sso;
updateresource.ssocredential = resource.ssocredential;
updateresource.ssodomain = resource.ssodomain;
updateresource.kcdaccount = resource.kcdaccount;
updateresource.httponlycookie = resource.httponlycookie;
updateresource.persistentcookie = resource.persistentcookie;
updateresource.persistentcookievalidity = resource.persistentcookievalidity;
updateresource.homepage = resource.homepage;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, tmsessionaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
tmsessionaction updateresources[] = new tmsessionaction[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new tmsessionaction();
updateresources[i].name = resources[i].name;
updateresources[i].sesstimeout = resources[i].sesstimeout;
updateresources[i].defaultauthorizationaction = resources[i].defaultauthorizationaction;
updateresources[i].sso = resources[i].sso;
updateresources[i].ssocredential = resources[i].ssocredential;
updateresources[i].ssodomain = resources[i].ssodomain;
updateresources[i].kcdaccount = resources[i].kcdaccount;
updateresources[i].httponlycookie = resources[i].httponlycookie;
updateresources[i].persistentcookie = resources[i].persistentcookie;
updateresources[i].persistentcookievalidity = resources[i].persistentcookievalidity;
updateresources[i].homepage = resources[i].homepage;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static tmsessionaction[] get(nitro_service service) throws Exception{
tmsessionaction obj = new tmsessionaction();
tmsessionaction[] response = (tmsessionaction[])obj.get_resources(service);
return response;
} | java |
public static tmsessionaction get(nitro_service service, String name) throws Exception{
tmsessionaction obj = new tmsessionaction();
obj.set_name(name);
tmsessionaction response = (tmsessionaction) obj.get_resource(service);
return response;
} | java |
public static base_response add(nitro_service client, lbwlm resource) throws Exception {
lbwlm addresource = new lbwlm();
addresource.wlmname = resource.wlmname;
addresource.ipaddress = resource.ipaddress;
addresource.port = resource.port;
addresource.lbuid = resource.lbuid;
addresource.katimeout = resource.katimeout;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, lbwlm resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbwlm addresources[] = new lbwlm[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new lbwlm();
addresources[i].wlmname = resources[i].wlmname;
addresources[i].ipaddress = resources[i].ipaddress;
addresources[i].port = resources[i].port;
addresources[i].lbuid = resources[i].lbuid;
addresources[i].katimeout = resources[i].katimeout;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response delete(nitro_service client, String wlmname) throws Exception {
lbwlm deleteresource = new lbwlm();
deleteresource.wlmname = wlmname;
return deleteresource.delete_resource(client);
} | java |
public static base_responses delete(nitro_service client, String wlmname[]) throws Exception {
base_responses result = null;
if (wlmname != null && wlmname.length > 0) {
lbwlm deleteresources[] = new lbwlm[wlmname.length];
for (int i=0;i<wlmname.length;i++){
deleteresources[i] = new lbwlm();
deleteresources[i].wlmname = wlmname[i];
}
result = delete_bulk_request(client, deleteresources);
}
return result;
} | java |
public static base_response update(nitro_service client, lbwlm resource) throws Exception {
lbwlm updateresource = new lbwlm();
updateresource.wlmname = resource.wlmname;
updateresource.katimeout = resource.katimeout;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, lbwlm resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
lbwlm updateresources[] = new lbwlm[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new lbwlm();
updateresources[i].wlmname = resources[i].wlmname;
updateresources[i].katimeout = resources[i].katimeout;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static base_response unset(nitro_service client, lbwlm resource, String[] args) throws Exception{
lbwlm unsetresource = new lbwlm();
unsetresource.wlmname = resource.wlmname;
return unsetresource.unset_resource(client,args);
} | java |
public static base_responses unset(nitro_service client, String wlmname[], String args[]) throws Exception {
base_responses result = null;
if (wlmname != null && wlmname.length > 0) {
lbwlm unsetresources[] = new lbwlm[wlmname.length];
for (int i=0;i<wlmname.length;i++){
unsetresources[i] = new lbwlm();
unsetresources[i].wlmname = wlmname[i];
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java |
public static lbwlm[] get(nitro_service service, options option) throws Exception{
lbwlm obj = new lbwlm();
lbwlm[] response = (lbwlm[])obj.get_resources(service,option);
return response;
} | java |
public static lbwlm get(nitro_service service, String wlmname) throws Exception{
lbwlm obj = new lbwlm();
obj.set_wlmname(wlmname);
lbwlm response = (lbwlm) obj.get_resource(service);
return response;
} | java |
public static lbwlm[] get(nitro_service service, String wlmname[]) throws Exception{
if (wlmname !=null && wlmname.length>0) {
lbwlm response[] = new lbwlm[wlmname.length];
lbwlm obj[] = new lbwlm[wlmname.length];
for (int i=0;i<wlmname.length;i++) {
obj[i] = new lbwlm();
obj[i].set_wlmname(wlmname[i]);
response[i] = (lbwlm) obj[i].get_resource(service);
}
return response;
}
return null;
} | java |
public static tmglobal_tmtrafficpolicy_binding[] get(nitro_service service) throws Exception{
tmglobal_tmtrafficpolicy_binding obj = new tmglobal_tmtrafficpolicy_binding();
tmglobal_tmtrafficpolicy_binding response[] = (tmglobal_tmtrafficpolicy_binding[]) obj.get_resources(service);
return response;
} | java |
public static base_response add(nitro_service client, vpnvserver resource) throws Exception {
vpnvserver addresource = new vpnvserver();
addresource.name = resource.name;
addresource.servicetype = resource.servicetype;
addresource.ipv46 = resource.ipv46;
addresource.range = resource.range;
addresource.port = resource.port;
addresource.state = resource.state;
addresource.authentication = resource.authentication;
addresource.doublehop = resource.doublehop;
addresource.maxaaausers = resource.maxaaausers;
addresource.icaonly = resource.icaonly;
addresource.downstateflush = resource.downstateflush;
addresource.listenpolicy = resource.listenpolicy;
addresource.listenpriority = resource.listenpriority;
addresource.tcpprofilename = resource.tcpprofilename;
addresource.httpprofilename = resource.httpprofilename;
addresource.comment = resource.comment;
addresource.appflowlog = resource.appflowlog;
addresource.icmpvsrresponse = resource.icmpvsrresponse;
addresource.netprofile = resource.netprofile;
addresource.cginfrahomepageredirect = resource.cginfrahomepageredirect;
addresource.maxloginattempts = resource.maxloginattempts;
addresource.failedlogintimeout = resource.failedlogintimeout;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, vpnvserver resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnvserver addresources[] = new vpnvserver[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new vpnvserver();
addresources[i].name = resources[i].name;
addresources[i].servicetype = resources[i].servicetype;
addresources[i].ipv46 = resources[i].ipv46;
addresources[i].range = resources[i].range;
addresources[i].port = resources[i].port;
addresources[i].state = resources[i].state;
addresources[i].authentication = resources[i].authentication;
addresources[i].doublehop = resources[i].doublehop;
addresources[i].maxaaausers = resources[i].maxaaausers;
addresources[i].icaonly = resources[i].icaonly;
addresources[i].downstateflush = resources[i].downstateflush;
addresources[i].listenpolicy = resources[i].listenpolicy;
addresources[i].listenpriority = resources[i].listenpriority;
addresources[i].tcpprofilename = resources[i].tcpprofilename;
addresources[i].httpprofilename = resources[i].httpprofilename;
addresources[i].comment = resources[i].comment;
addresources[i].appflowlog = resources[i].appflowlog;
addresources[i].icmpvsrresponse = resources[i].icmpvsrresponse;
addresources[i].netprofile = resources[i].netprofile;
addresources[i].cginfrahomepageredirect = resources[i].cginfrahomepageredirect;
addresources[i].maxloginattempts = resources[i].maxloginattempts;
addresources[i].failedlogintimeout = resources[i].failedlogintimeout;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response update(nitro_service client, vpnvserver resource) throws Exception {
vpnvserver updateresource = new vpnvserver();
updateresource.name = resource.name;
updateresource.ipv46 = resource.ipv46;
updateresource.authentication = resource.authentication;
updateresource.doublehop = resource.doublehop;
updateresource.icaonly = resource.icaonly;
updateresource.maxaaausers = resource.maxaaausers;
updateresource.downstateflush = resource.downstateflush;
updateresource.listenpolicy = resource.listenpolicy;
updateresource.listenpriority = resource.listenpriority;
updateresource.tcpprofilename = resource.tcpprofilename;
updateresource.httpprofilename = resource.httpprofilename;
updateresource.comment = resource.comment;
updateresource.appflowlog = resource.appflowlog;
updateresource.icmpvsrresponse = resource.icmpvsrresponse;
updateresource.netprofile = resource.netprofile;
updateresource.cginfrahomepageredirect = resource.cginfrahomepageredirect;
updateresource.maxloginattempts = resource.maxloginattempts;
updateresource.failedlogintimeout = resource.failedlogintimeout;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, vpnvserver resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vpnvserver updateresources[] = new vpnvserver[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new vpnvserver();
updateresources[i].name = resources[i].name;
updateresources[i].ipv46 = resources[i].ipv46;
updateresources[i].authentication = resources[i].authentication;
updateresources[i].doublehop = resources[i].doublehop;
updateresources[i].icaonly = resources[i].icaonly;
updateresources[i].maxaaausers = resources[i].maxaaausers;
updateresources[i].downstateflush = resources[i].downstateflush;
updateresources[i].listenpolicy = resources[i].listenpolicy;
updateresources[i].listenpriority = resources[i].listenpriority;
updateresources[i].tcpprofilename = resources[i].tcpprofilename;
updateresources[i].httpprofilename = resources[i].httpprofilename;
updateresources[i].comment = resources[i].comment;
updateresources[i].appflowlog = resources[i].appflowlog;
updateresources[i].icmpvsrresponse = resources[i].icmpvsrresponse;
updateresources[i].netprofile = resources[i].netprofile;
updateresources[i].cginfrahomepageredirect = resources[i].cginfrahomepageredirect;
updateresources[i].maxloginattempts = resources[i].maxloginattempts;
updateresources[i].failedlogintimeout = resources[i].failedlogintimeout;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static vpnvserver[] get(nitro_service service) throws Exception{
vpnvserver obj = new vpnvserver();
vpnvserver[] response = (vpnvserver[])obj.get_resources(service);
return response;
} | java |
public static vpnvserver get(nitro_service service, String name) throws Exception{
vpnvserver obj = new vpnvserver();
obj.set_name(name);
vpnvserver response = (vpnvserver) obj.get_resource(service);
return response;
} | java |
public static rewritepolicy_rewritepolicylabel_binding[] get(nitro_service service, String name) throws Exception{
rewritepolicy_rewritepolicylabel_binding obj = new rewritepolicy_rewritepolicylabel_binding();
obj.set_name(name);
rewritepolicy_rewritepolicylabel_binding response[] = (rewritepolicy_rewritepolicylabel_binding[]) obj.get_resources(service);
return response;
} | java |
private static String delimit(String s, char c) {
int i = s.indexOf(c);
while (i != -1) {
if (i == 0 || s.charAt(i - 1) != '\\') {
s = s.substring(0, i) + '\\' + s.substring(i);
i = s.indexOf(c, i + 2);
} else {
i = s.indexOf(c, i + 1);
}
}
return s;
} | java |
private Object getNext(String txt, String originalText) {
if (invertible) {
String str = prevWordAfter.toString();
prevWordAfter.setLength(0);
CoreLabel word = (CoreLabel) tokenFactory.makeToken(txt, yychar, yylength());
word.set(OriginalTextAnnotation.class, originalText);
word.set(BeforeAnnotation.class, str);
prevWord.set(AfterAnnotation.class, str);
prevWord = word;
return word;
} else {
return tokenFactory.makeToken(txt, yychar, yylength());
}
} | java |
public static vpntrafficpolicy_binding get(nitro_service service, String name) throws Exception{
vpntrafficpolicy_binding obj = new vpntrafficpolicy_binding();
obj.set_name(name);
vpntrafficpolicy_binding response = (vpntrafficpolicy_binding) obj.get_resource(service);
return response;
} | java |
public static vpnvserver_vpnclientlessaccesspolicy_binding[] get(nitro_service service, String name) throws Exception{
vpnvserver_vpnclientlessaccesspolicy_binding obj = new vpnvserver_vpnclientlessaccesspolicy_binding();
obj.set_name(name);
vpnvserver_vpnclientlessaccesspolicy_binding response[] = (vpnvserver_vpnclientlessaccesspolicy_binding[]) obj.get_resources(service);
return response;
} | java |
public static authenticationsamlpolicy_binding get(nitro_service service, String name) throws Exception{
authenticationsamlpolicy_binding obj = new authenticationsamlpolicy_binding();
obj.set_name(name);
authenticationsamlpolicy_binding response = (authenticationsamlpolicy_binding) obj.get_resource(service);
return response;
} | java |
public static base_response unset(nitro_service client, autoscalepolicy resource, String[] args) throws Exception{
autoscalepolicy unsetresource = new autoscalepolicy();
unsetresource.name = resource.name;
unsetresource.rule = resource.rule;
unsetresource.action = resource.action;
unsetresource.comment = resource.comment;
unsetresource.logaction = resource.logaction;
return unsetresource.unset_resource(client,args);
} | java |
public static base_responses unset(nitro_service client, autoscalepolicy resources[], String[] args) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
autoscalepolicy unsetresources[] = new autoscalepolicy[resources.length];
for (int i=0;i<resources.length;i++){
unsetresources[i] = new autoscalepolicy();
unsetresources[i].name = resources[i].name;
unsetresources[i].rule = resources[i].rule;
unsetresources[i].action = resources[i].action;
unsetresources[i].comment = resources[i].comment;
unsetresources[i].logaction = resources[i].logaction;
}
result = unset_bulk_request(client, unsetresources,args);
}
return result;
} | java |
public static autoscalepolicy[] get(nitro_service service) throws Exception{
autoscalepolicy obj = new autoscalepolicy();
autoscalepolicy[] response = (autoscalepolicy[])obj.get_resources(service);
return response;
} | java |
public static autoscalepolicy get(nitro_service service, String name) throws Exception{
autoscalepolicy obj = new autoscalepolicy();
obj.set_name(name);
autoscalepolicy response = (autoscalepolicy) obj.get_resource(service);
return response;
} | java |
public static aaauser_vpnintranetapplication_binding[] get(nitro_service service, String username) throws Exception{
aaauser_vpnintranetapplication_binding obj = new aaauser_vpnintranetapplication_binding();
obj.set_username(username);
aaauser_vpnintranetapplication_binding response[] = (aaauser_vpnintranetapplication_binding[]) obj.get_resources(service);
return response;
} | java |
public static long count(nitro_service service, String username) throws Exception{
aaauser_vpnintranetapplication_binding obj = new aaauser_vpnintranetapplication_binding();
obj.set_username(username);
options option = new options();
option.set_count(true);
aaauser_vpnintranetapplication_binding response[] = (aaauser_vpnintranetapplication_binding[]) obj.get_resources(service,option);
if (response != null) {
return response[0].__count;
}
return 0;
} | java |
public static base_responses add(nitro_service client, responderpolicylabel resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
responderpolicylabel addresources[] = new responderpolicylabel[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new responderpolicylabel();
addresources[i].labelname = resources[i].labelname;
addresources[i].policylabeltype = resources[i].policylabeltype;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static responderpolicylabel[] get(nitro_service service, options option) throws Exception{
responderpolicylabel obj = new responderpolicylabel();
responderpolicylabel[] response = (responderpolicylabel[])obj.get_resources(service,option);
return response;
} | java |
public static responderpolicylabel get(nitro_service service, String labelname) throws Exception{
responderpolicylabel obj = new responderpolicylabel();
obj.set_labelname(labelname);
responderpolicylabel response = (responderpolicylabel) obj.get_resource(service);
return response;
} | java |
public static channel_interface_binding[] get(nitro_service service, String id) throws Exception{
channel_interface_binding obj = new channel_interface_binding();
obj.set_id(id);
channel_interface_binding response[] = (channel_interface_binding[]) obj.get_resources(service);
return response;
} | java |
private static void getDep(TreeGraphNode t, List<TypedDependency> basicDep,
Filter<TypedDependency> f) {
if (t.isPhrasal()) { // don't do leaves of POS tags (chris changed this from numChildren > 0 in 2010)
Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> depMap = getAllDependents(t);
for (Class<? extends CoreAnnotation> depName : depMap.keySet()) {
for (TreeGraphNode depNode : depMap.get(depName)) {
TreeGraphNode gov = t.headWordNode();
TreeGraphNode dep = depNode.headWordNode();
if (gov != dep) {
List<GrammaticalRelation> rels = getListGrammaticalRelation(t, depNode);
if (!rels.isEmpty()) {
for (GrammaticalRelation rel : rels) {
TypedDependency newDep = new TypedDependency(rel, gov, dep);
if (!basicDep.contains(newDep) && f.accept(newDep)) {
newDep.setExtra();
basicDep.add(newDep);
}
}
}
}
}
}
// now recurse into children
for (Tree kid : t.children()) {
getDep((TreeGraphNode) kid, basicDep, f);
}
}
} | java |
public static List<GrammaticalRelation> getListGrammaticalRelation(TreeGraphNode gov, TreeGraphNode dep) {
List<GrammaticalRelation> list = new ArrayList<GrammaticalRelation>();
TreeGraphNode govH = gov.highestNodeWithSameHead();
TreeGraphNode depH = dep.highestNodeWithSameHead();
/*System.out.println("Extra gov node " + gov);
System.out.println("govH " + govH);
System.out.println("dep node " + dep);
System.out.println("depH " + depH);*/
Set<Class<? extends GrammaticalRelationAnnotation>> arcLabels = govH.arcLabelsToNode(depH);
//System.out.println("arcLabels: " + arcLabels);
if (dep != depH) {
Set<Class<? extends GrammaticalRelationAnnotation>> arcLabels2 = govH.arcLabelsToNode(dep);
//System.out.println("arcLabels2: " + arcLabels2);
arcLabels.addAll(arcLabels2);
}
//System.out.println("arcLabels: " + arcLabels);
for (Class<? extends GrammaticalRelationAnnotation> arcLabel : arcLabels) {
if (arcLabel != null) {
GrammaticalRelation reln2 = GrammaticalRelation.getRelation(arcLabel);
if (!list.isEmpty()) {
for (int i = 0; i < list.size(); i++) {
GrammaticalRelation gr = list.get(i);
//if the element in the list is an ancestor of the current relation, replace it
if (gr.isAncestor(reln2)) {
int index = list.indexOf(gr);
list.set(index, reln2);
}
//if the relation is not an ancestor of an element in the list, we add the relation
else if (!reln2.isAncestor(gr)) {
list.add(reln2);
}
}
} else {
list.add(reln2);
}
}
}
//System.out.println("in list " + list);
return list;
} | java |
public List<String> getDependencyPath(int nodeIndex, int rootIndex) {
TreeGraphNode node = getNodeByIndex(nodeIndex);
TreeGraphNode rootTree = getNodeByIndex(rootIndex);
return getDependencyPath(node, rootTree);
} | java |
private static List<String> getDependencyPath(TreeGraphNode node, TreeGraphNode root) {
List<String> path = new ArrayList<String>();
while (!node.equals(root)) {
TreeGraphNode gov = getGovernor(node);
// System.out.println("Governor for \"" + node.value() + "\": \"" + gov.value() + "\"");
List<GrammaticalRelation> relations = getListGrammaticalRelation(gov, node);
StringBuilder sb = new StringBuilder();
for (GrammaticalRelation relation : relations) {
//if (!arcLabel.equals(GOVERNOR))
sb.append((sb.length() == 0 ? "" : "+")).append(relation.toString());
}
path.add(sb.toString());
node = gov;
}
return path;
} | java |
private static Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> getAllDependents(TreeGraphNode node) {
Map<Class<? extends CoreAnnotation>, Set<TreeGraphNode>> newMap = Generics.newHashMap();
for (Class<?> o : node.label.keySet()) {
try {
// The line below will exception unless it's a GrammaticalRelationAnnotation,
// so the effect is that only the GrammaticalRelationAnnotation things get put into newMap
o.asSubclass(GrammaticalRelationAnnotation.class);
newMap.put((Class<? extends CoreAnnotation>) o, (Set<TreeGraphNode>) node.label.get((Class<? extends CoreAnnotation>) o));//javac doesn't compile properly if generics are fully specified (but eclipse does...)
} catch (Exception e) {
// ignore a non-GrammaticalRelationAnnotation element
}
}
return newMap;
} | java |
public static Collection<TypedDependency> getRoots(Collection<TypedDependency> list) {
Collection<TypedDependency> roots = new ArrayList<TypedDependency>();
// need to see if more than one governor is not listed somewhere as a dependent
// first take all the deps
Collection<TreeGraphNode> deps = new HashSet<TreeGraphNode>();
for (TypedDependency typedDep : list) {
deps.add(typedDep.dep());
}
// go through the list and add typedDependency for which the gov is not a dep
Collection<TreeGraphNode> govs = new HashSet<TreeGraphNode>();
for (TypedDependency typedDep : list) {
TreeGraphNode gov = typedDep.gov();
if (!deps.contains(gov) && !govs.contains(gov)) {
roots.add(typedDep);
}
govs.add(gov);
}
return roots;
} | java |
public static void printDependencies(GrammaticalStructure gs, Collection<TypedDependency> deps, Tree tree, boolean conllx, boolean extraSep) {
System.out.println(dependenciesToString(gs, deps, tree, conllx, extraSep));
} | java |
public static List<GrammaticalStructure> readCoNLLXGrammaticStructureCollection(String fileName, Map<String, GrammaticalRelation> shortNameToGRel, GrammaticalStructureFromDependenciesFactory factory) throws IOException {
LineNumberReader reader = new LineNumberReader(new FileReader(fileName));
List<GrammaticalStructure> gsList = new LinkedList<GrammaticalStructure>();
List<List<String>> tokenFields = new ArrayList<List<String>>();
for (String inline = reader.readLine(); inline != null;
inline = reader.readLine()) {
if (!"".equals(inline)) {
// read in a single sentence token by token
List<String> fields = Arrays.asList(inline.split("\t"));
if (fields.size() != CoNLLX_FieldCount) {
throw new RuntimeException(String.format("Error (line %d): 10 fields expected but %d are present", reader.getLineNumber(), fields.size()));
}
tokenFields.add(fields);
} else {
if (tokenFields.isEmpty())
continue; // skip excess empty lines
gsList.add(buildCoNNLXGrammaticStructure(tokenFields, shortNameToGRel, factory));
tokenFields = new ArrayList<List<String>>();
}
}
return gsList;
} | java |
public static auditnslogpolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{
auditnslogpolicy_vpnglobal_binding obj = new auditnslogpolicy_vpnglobal_binding();
obj.set_name(name);
auditnslogpolicy_vpnglobal_binding response[] = (auditnslogpolicy_vpnglobal_binding[]) obj.get_resources(service);
return response;
} | java |
public static protocolicmp_stats get(nitro_service service) throws Exception{
protocolicmp_stats obj = new protocolicmp_stats();
protocolicmp_stats[] response = (protocolicmp_stats[])obj.stat_resources(service);
return response[0];
} | java |
public static base_response add(nitro_service client, ip6tunnel resource) throws Exception {
ip6tunnel addresource = new ip6tunnel();
addresource.name = resource.name;
addresource.remote = resource.remote;
addresource.local = resource.local;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, ip6tunnel resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
ip6tunnel addresources[] = new ip6tunnel[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new ip6tunnel();
addresources[i].name = resources[i].name;
addresources[i].remote = resources[i].remote;
addresources[i].local = resources[i].local;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static ip6tunnel[] get(nitro_service service) throws Exception{
ip6tunnel obj = new ip6tunnel();
ip6tunnel[] response = (ip6tunnel[])obj.get_resources(service);
return response;
} | java |
public static ip6tunnel[] get(nitro_service service, ip6tunnel_args args) throws Exception{
ip6tunnel obj = new ip6tunnel();
options option = new options();
option.set_args(nitro_util.object_to_string_withoutquotes(args));
ip6tunnel[] response = (ip6tunnel[])obj.get_resources(service, option);
return response;
} | java |
public static ip6tunnel get(nitro_service service, String name) throws Exception{
ip6tunnel obj = new ip6tunnel();
obj.set_name(name);
ip6tunnel response = (ip6tunnel) obj.get_resource(service);
return response;
} | java |
public static base_response add(nitro_service client, transformaction resource) throws Exception {
transformaction addresource = new transformaction();
addresource.name = resource.name;
addresource.profilename = resource.profilename;
addresource.priority = resource.priority;
addresource.state = resource.state;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, transformaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
transformaction addresources[] = new transformaction[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new transformaction();
addresources[i].name = resources[i].name;
addresources[i].profilename = resources[i].profilename;
addresources[i].priority = resources[i].priority;
addresources[i].state = resources[i].state;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response update(nitro_service client, transformaction resource) throws Exception {
transformaction updateresource = new transformaction();
updateresource.name = resource.name;
updateresource.priority = resource.priority;
updateresource.requrlfrom = resource.requrlfrom;
updateresource.requrlinto = resource.requrlinto;
updateresource.resurlfrom = resource.resurlfrom;
updateresource.resurlinto = resource.resurlinto;
updateresource.cookiedomainfrom = resource.cookiedomainfrom;
updateresource.cookiedomaininto = resource.cookiedomaininto;
updateresource.state = resource.state;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, transformaction resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
transformaction updateresources[] = new transformaction[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new transformaction();
updateresources[i].name = resources[i].name;
updateresources[i].priority = resources[i].priority;
updateresources[i].requrlfrom = resources[i].requrlfrom;
updateresources[i].requrlinto = resources[i].requrlinto;
updateresources[i].resurlfrom = resources[i].resurlfrom;
updateresources[i].resurlinto = resources[i].resurlinto;
updateresources[i].cookiedomainfrom = resources[i].cookiedomainfrom;
updateresources[i].cookiedomaininto = resources[i].cookiedomaininto;
updateresources[i].state = resources[i].state;
updateresources[i].comment = resources[i].comment;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static transformaction[] get(nitro_service service) throws Exception{
transformaction obj = new transformaction();
transformaction[] response = (transformaction[])obj.get_resources(service);
return response;
} | java |
public static transformaction get(nitro_service service, String name) throws Exception{
transformaction obj = new transformaction();
obj.set_name(name);
transformaction response = (transformaction) obj.get_resource(service);
return response;
} | java |
public int readBit() throws IOException {
if (bitCount == 0) {
bitBuffer = read();
if (bitBuffer == -1) {
throw new IOException("no more bits");
}
}
int value = (bitBuffer >> bitCount) & 1;
bitCount++;
if (bitCount > 7) {
bitCount = 0;
}
return value;
} | java |
public byte[] readRemainingBytes() throws IOException {
if (this.available() > 0) {
byte[] b = new byte[this.available()];
if (read(b) >= 0) {
return b;
} else {
throw new IOException("returned negative number of remaining bytes");
}
} else {
throw new IOException("no more bytes");
}
} | java |
public int readEliasGammaCodingPositiveInteger() throws IOException {
int value;
int counter = 0;
int bit = readBit();
while (bit == 0) {
counter++;
bit = readBit();
}
value = 1;
for (int i = 0; i < counter; i++) {
value = (2 * value) + readBit();
}
return value;
} | java |
public static base_response add(nitro_service client, vrid resource) throws Exception {
vrid addresource = new vrid();
addresource.id = resource.id;
addresource.priority = resource.priority;
addresource.preemption = resource.preemption;
addresource.sharing = resource.sharing;
addresource.tracking = resource.tracking;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, vrid resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vrid addresources[] = new vrid[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new vrid();
addresources[i].id = resources[i].id;
addresources[i].priority = resources[i].priority;
addresources[i].preemption = resources[i].preemption;
addresources[i].sharing = resources[i].sharing;
addresources[i].tracking = resources[i].tracking;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response delete(nitro_service client, vrid resource) throws Exception {
vrid deleteresource = new vrid();
deleteresource.id = resource.id;
deleteresource.all = resource.all;
return deleteresource.delete_resource(client);
} | java |
public static base_response update(nitro_service client, vrid resource) throws Exception {
vrid updateresource = new vrid();
updateresource.id = resource.id;
updateresource.priority = resource.priority;
updateresource.preemption = resource.preemption;
updateresource.sharing = resource.sharing;
updateresource.tracking = resource.tracking;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, vrid resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
vrid updateresources[] = new vrid[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new vrid();
updateresources[i].id = resources[i].id;
updateresources[i].priority = resources[i].priority;
updateresources[i].preemption = resources[i].preemption;
updateresources[i].sharing = resources[i].sharing;
updateresources[i].tracking = resources[i].tracking;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static vrid[] get(nitro_service service) throws Exception{
vrid obj = new vrid();
vrid[] response = (vrid[])obj.get_resources(service);
return response;
} | java |
public static vrid get(nitro_service service, Long id) throws Exception{
vrid obj = new vrid();
obj.set_id(id);
vrid response = (vrid) obj.get_resource(service);
return response;
} | java |
public static base_response add(nitro_service client, nshttpprofile resource) throws Exception {
nshttpprofile addresource = new nshttpprofile();
addresource.name = resource.name;
addresource.dropinvalreqs = resource.dropinvalreqs;
addresource.markhttp09inval = resource.markhttp09inval;
addresource.markconnreqinval = resource.markconnreqinval;
addresource.cmponpush = resource.cmponpush;
addresource.conmultiplex = resource.conmultiplex;
addresource.maxreusepool = resource.maxreusepool;
addresource.dropextracrlf = resource.dropextracrlf;
addresource.incomphdrdelay = resource.incomphdrdelay;
addresource.websocket = resource.websocket;
addresource.reqtimeout = resource.reqtimeout;
addresource.adpttimeout = resource.adpttimeout;
addresource.reqtimeoutaction = resource.reqtimeoutaction;
addresource.dropextradata = resource.dropextradata;
addresource.weblog = resource.weblog;
addresource.clientiphdrexpr = resource.clientiphdrexpr;
addresource.maxreq = resource.maxreq;
addresource.persistentetag = resource.persistentetag;
addresource.spdy = resource.spdy;
return addresource.add_resource(client);
} | java |
public static base_response update(nitro_service client, nshttpprofile resource) throws Exception {
nshttpprofile updateresource = new nshttpprofile();
updateresource.name = resource.name;
updateresource.dropinvalreqs = resource.dropinvalreqs;
updateresource.markhttp09inval = resource.markhttp09inval;
updateresource.markconnreqinval = resource.markconnreqinval;
updateresource.cmponpush = resource.cmponpush;
updateresource.conmultiplex = resource.conmultiplex;
updateresource.maxreusepool = resource.maxreusepool;
updateresource.dropextracrlf = resource.dropextracrlf;
updateresource.incomphdrdelay = resource.incomphdrdelay;
updateresource.websocket = resource.websocket;
updateresource.reqtimeout = resource.reqtimeout;
updateresource.adpttimeout = resource.adpttimeout;
updateresource.reqtimeoutaction = resource.reqtimeoutaction;
updateresource.dropextradata = resource.dropextradata;
updateresource.weblog = resource.weblog;
updateresource.clientiphdrexpr = resource.clientiphdrexpr;
updateresource.maxreq = resource.maxreq;
updateresource.persistentetag = resource.persistentetag;
updateresource.spdy = resource.spdy;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, nshttpprofile resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
nshttpprofile updateresources[] = new nshttpprofile[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new nshttpprofile();
updateresources[i].name = resources[i].name;
updateresources[i].dropinvalreqs = resources[i].dropinvalreqs;
updateresources[i].markhttp09inval = resources[i].markhttp09inval;
updateresources[i].markconnreqinval = resources[i].markconnreqinval;
updateresources[i].cmponpush = resources[i].cmponpush;
updateresources[i].conmultiplex = resources[i].conmultiplex;
updateresources[i].maxreusepool = resources[i].maxreusepool;
updateresources[i].dropextracrlf = resources[i].dropextracrlf;
updateresources[i].incomphdrdelay = resources[i].incomphdrdelay;
updateresources[i].websocket = resources[i].websocket;
updateresources[i].reqtimeout = resources[i].reqtimeout;
updateresources[i].adpttimeout = resources[i].adpttimeout;
updateresources[i].reqtimeoutaction = resources[i].reqtimeoutaction;
updateresources[i].dropextradata = resources[i].dropextradata;
updateresources[i].weblog = resources[i].weblog;
updateresources[i].clientiphdrexpr = resources[i].clientiphdrexpr;
updateresources[i].maxreq = resources[i].maxreq;
updateresources[i].persistentetag = resources[i].persistentetag;
updateresources[i].spdy = resources[i].spdy;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static nshttpprofile[] get(nitro_service service) throws Exception{
nshttpprofile obj = new nshttpprofile();
nshttpprofile[] response = (nshttpprofile[])obj.get_resources(service);
return response;
} | java |
public static nshttpprofile get(nitro_service service, String name) throws Exception{
nshttpprofile obj = new nshttpprofile();
obj.set_name(name);
nshttpprofile response = (nshttpprofile) obj.get_resource(service);
return response;
} | java |
public static base_response update(nitro_service client, vpathparam resource) throws Exception {
vpathparam updateresource = new vpathparam();
updateresource.srcip = resource.srcip;
return updateresource.update_resource(client);
} | java |
public static base_response unset(nitro_service client, vpathparam resource, String[] args) throws Exception{
vpathparam unsetresource = new vpathparam();
return unsetresource.unset_resource(client,args);
} | java |
public static vpathparam get(nitro_service service) throws Exception{
vpathparam obj = new vpathparam();
vpathparam[] response = (vpathparam[])obj.get_resources(service);
return response[0];
} | java |
protected void setUp(int initialCapacity, double minLoadFactor, double maxLoadFactor) {
int capacity = initialCapacity;
super.setUp(capacity, minLoadFactor, maxLoadFactor);
capacity = nextPrime(capacity);
if (capacity==0) capacity=1; // open addressing needs at least one FREE slot at any time.
this.table = new int[capacity];
this.values = new Object[capacity];
this.state = new byte[capacity];
// memory will be exhausted long before this pathological case happens, anyway.
this.minLoadFactor = minLoadFactor;
if (capacity == PrimeFinder.largestPrime) this.maxLoadFactor = 1.0;
else this.maxLoadFactor = maxLoadFactor;
this.distinct = 0;
this.freeEntries = capacity; // delta
// lowWaterMark will be established upon first expansion.
// establishing it now (upon instance construction) would immediately make the table shrink upon first put(...).
// After all the idea of an "initialCapacity" implies violating lowWaterMarks when an object is young.
// See ensureCapacity(...)
this.lowWaterMark = 0;
this.highWaterMark = chooseHighWaterMark(capacity, this.maxLoadFactor);
} | java |
public static base_response add(nitro_service client, appfwfieldtype resource) throws Exception {
appfwfieldtype addresource = new appfwfieldtype();
addresource.name = resource.name;
addresource.regex = resource.regex;
addresource.priority = resource.priority;
addresource.comment = resource.comment;
return addresource.add_resource(client);
} | java |
public static base_responses add(nitro_service client, appfwfieldtype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwfieldtype addresources[] = new appfwfieldtype[resources.length];
for (int i=0;i<resources.length;i++){
addresources[i] = new appfwfieldtype();
addresources[i].name = resources[i].name;
addresources[i].regex = resources[i].regex;
addresources[i].priority = resources[i].priority;
addresources[i].comment = resources[i].comment;
}
result = add_bulk_request(client, addresources);
}
return result;
} | java |
public static base_response update(nitro_service client, appfwfieldtype resource) throws Exception {
appfwfieldtype updateresource = new appfwfieldtype();
updateresource.name = resource.name;
updateresource.regex = resource.regex;
updateresource.priority = resource.priority;
updateresource.comment = resource.comment;
return updateresource.update_resource(client);
} | java |
public static base_responses update(nitro_service client, appfwfieldtype resources[]) throws Exception {
base_responses result = null;
if (resources != null && resources.length > 0) {
appfwfieldtype updateresources[] = new appfwfieldtype[resources.length];
for (int i=0;i<resources.length;i++){
updateresources[i] = new appfwfieldtype();
updateresources[i].name = resources[i].name;
updateresources[i].regex = resources[i].regex;
updateresources[i].priority = resources[i].priority;
updateresources[i].comment = resources[i].comment;
}
result = update_bulk_request(client, updateresources);
}
return result;
} | java |
public static appfwfieldtype[] get(nitro_service service) throws Exception{
appfwfieldtype obj = new appfwfieldtype();
appfwfieldtype[] response = (appfwfieldtype[])obj.get_resources(service);
return response;
} | java |
public static appfwfieldtype get(nitro_service service, String name) throws Exception{
appfwfieldtype obj = new appfwfieldtype();
obj.set_name(name);
appfwfieldtype response = (appfwfieldtype) obj.get_resource(service);
return response;
} | java |
public static vpnvserver_stats[] get(nitro_service service) throws Exception{
vpnvserver_stats obj = new vpnvserver_stats();
vpnvserver_stats[] response = (vpnvserver_stats[])obj.stat_resources(service);
return response;
} | java |
public static vpnvserver_stats get(nitro_service service, String name) throws Exception{
vpnvserver_stats obj = new vpnvserver_stats();
obj.set_name(name);
vpnvserver_stats response = (vpnvserver_stats) obj.stat_resource(service);
return response;
} | java |
public static hanode_binding get(nitro_service service, Long id) throws Exception{
hanode_binding obj = new hanode_binding();
obj.set_id(id);
hanode_binding response = (hanode_binding) obj.get_resource(service);
return response;
} | java |
public void setLimits(int softLimit, int hardLimit) {
if ((softLimit > 0 && hardLimit > softLimit) || (softLimit == 0 && hardLimit == 0)) {
this.softLimit = softLimit;
this.hardLimit = hardLimit;
garbageCollect();
} else {
throw new IllegalArgumentException();
}
} | java |
@Override
public Tree evaluate(Tree t, TregexMatcher m) {
newNodeNames = new HashMap<String,Tree>();
coindexer.setLastIndex(t);
for (TsurgeonPattern child : children) {
t = child.evaluate(t, m);
if (t == null) {
return null;
}
}
return t;
} | java |
private void generatePermutations(
ArrayList<HashMap<String, String[]>[]> result, int index,
HashMap<String, String[]>[][] subResult) {
int localIndex = index;
HashMap<String, String[]>[] value = subResult[localIndex];
if (localIndex == 0) {
for (int i = 0; i < value.length; i++) {
HashMap<String, String[]>[] resultItem = new HashMap[subResult.length];
resultItem[localIndex] = value[i];
result.add(resultItem);
}
} else {
ArrayList<HashMap<String, String[]>[]> newResult = new ArrayList<>();
for (int e = 0; e < result.size(); e++) {
for (int i = 0; i < value.length; i++) {
HashMap<String, String[]>[] resultItem = result.get(e);
resultItem[localIndex] = value[i];
newResult.add(resultItem);
}
}
result.clear();
result.addAll(newResult);
}
localIndex++;
if (localIndex < subResult.length) {
generatePermutations(result, localIndex, subResult);
}
} | java |
private void generatePermutationsQueryVariables(
ArrayList<HashMap<String, String[]>> result, Set<String> keys,
HashMap<String, String[]> queryVariables) {
if (keys != null && !keys.isEmpty()) {
Set<String> newKeys = new HashSet<>();
Iterator<String> it = keys.iterator();
String key = it.next();
String[] value = queryVariables.get(key);
if (result.isEmpty()) {
HashMap<String, String[]> newItem;
if (value == null || value.length == 0) {
newItem = new HashMap<>();
newItem.put(key, value);
result.add(newItem);
} else {
for (int j = 0; j < value.length; j++) {
newItem = new HashMap<>();
newItem.put(key, new String[] { value[j] });
result.add(newItem);
}
}
} else {
ArrayList<HashMap<String, String[]>> newResult = new ArrayList<>();
for (int i = 0; i < result.size(); i++) {
HashMap<String, String[]> newItem;
if (value == null || value.length == 0) {
newItem = (HashMap<String, String[]>) result.get(i).clone();
newItem.put(key, value);
newResult.add(newItem);
} else {
for (int j = 0; j < value.length; j++) {
newItem = (HashMap<String, String[]>) result.get(i).clone();
newItem.put(key, new String[] { value[j] });
newResult.add(newItem);
}
}
}
result.clear();
result.addAll(newResult);
}
while (it.hasNext()) {
newKeys.add(it.next());
}
generatePermutationsQueryVariables(result, newKeys, queryVariables);
}
} | java |
private SimpleOrderedMap<Object> createPosition(ComponentPosition position,
Boolean encode) throws IOException {
// System.out.println("Create stats position " + position.dataType + " "
// + position.statsType + " " + position.statsItems + " --- " + encode);
SimpleOrderedMap<Object> mtasPositionResponse = new SimpleOrderedMap<>();
mtasPositionResponse.add("key", position.key);
MtasSolrMtasResult data = new MtasSolrMtasResult(position.dataCollector,
position.dataType, position.statsType, position.statsItems, null, null);
if (encode) {
mtasPositionResponse.add("_encoded_data",
MtasSolrResultUtil.encode(data));
} else {
mtasPositionResponse.add(position.dataCollector.getCollectorType(), data);
MtasSolrResultUtil.rewrite(mtasPositionResponse, searchComponent);
}
return mtasPositionResponse;
} | java |
private SimpleOrderedMap<Object> createToken(ComponentToken token,
Boolean encode) throws IOException {
// System.out.println("Create stats position " + position.dataType + " "
// + position.statsType + " " + position.statsItems + " --- " + encode);
SimpleOrderedMap<Object> mtasTokenResponse = new SimpleOrderedMap<>();
mtasTokenResponse.add("key", token.key);
MtasSolrMtasResult data = new MtasSolrMtasResult(token.dataCollector,
token.dataType, token.statsType, token.statsItems, null, null);
if (encode) {
mtasTokenResponse.add("_encoded_data", MtasSolrResultUtil.encode(data));
} else {
mtasTokenResponse.add(token.dataCollector.getCollectorType(), data);
MtasSolrResultUtil.rewrite(mtasTokenResponse, searchComponent);
}
return mtasTokenResponse;
} | java |
@SuppressWarnings("unchecked")
private SimpleOrderedMap<Object> createSpan(ComponentSpan span,
Boolean encode) throws IOException {
// System.out.println("Create stats span " + span.dataType + " "
// + span.statsType + " " + span.statsItems + " --- " + encode);
SimpleOrderedMap<Object> mtasSpanResponse = new SimpleOrderedMap<>();
mtasSpanResponse.add("key", span.key);
HashMap<MtasDataCollector<?, ?>, HashMap<String, MtasSolrMtasResult>> functionData = new HashMap<>();
HashMap<String, MtasSolrMtasResult> functionDataItem = new HashMap<>();
functionData.put(span.dataCollector, functionDataItem);
if (span.functions != null) {
for (SubComponentFunction function : span.functions) {
function.dataCollector.close();
functionDataItem.put(function.key, new MtasSolrMtasResult(
function.dataCollector, new String[] { function.dataType },
new String[] { function.statsType },
new SortedSet[] { function.statsItems }, new List[] { null },
new String[] { null }, new String[] { null }, new Integer[] { 0 },
new Integer[] { Integer.MAX_VALUE }, null));
}
}
MtasSolrMtasResult data = new MtasSolrMtasResult(span.dataCollector,
span.dataType, span.statsType, span.statsItems, null, functionData);
if (encode) {
mtasSpanResponse.add("_encoded_data", MtasSolrResultUtil.encode(data));
} else {
mtasSpanResponse.add(span.dataCollector.getCollectorType(), data);
MtasSolrResultUtil.rewrite(mtasSpanResponse, searchComponent);
}
return mtasSpanResponse;
} | java |
public final String shardKey(int stage) {
if (shardStageKeys == null) {
return null;
} else {
shardKey = shardStageKeys.get(stage);
if (shardKey == null) {
shardKey = UUID.randomUUID().toString();
shardStageKeys.put(stage, shardKey);
}
return shardKey;
}
} | java |
public final void setFinished() {
if (!finished) {
totalTime = ((Long) (System.currentTimeMillis() - startTime)).intValue();
shardInfoUpdated = false;
finished = true;
rsp = null;
}
} | java |
public void setKey(String key) throws IOException {
if (this.key != null) {
throw new IOException("key already set");
} else {
this.key = Objects.requireNonNull(key, "key required");
}
} | java |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.