public static final int IDENT_MAX = 128;
public static final int PATH_MAX = 1024;
private void registerSystemProcedures() {
NewAISBuilder aisb = AISBBasedBuilder.create(schemaManager.getTypesTranslator());
aisb.defaultSchema(TableName.SYS_SCHEMA);
aisb.procedure("dump_group")
.language("java", Routine.CallingConvention.LOADABLE_PLAN)
.paramStringIn("schema_name", IDENT_MAX)
.paramStringIn("table_name", IDENT_MAX)
.paramLongIn("insert_max_row_count")
.externalName(DumpGroupLoadablePlan.class.getCanonicalName());
aisb.procedure("group_protobuf")
.language("java", Routine.CallingConvention.LOADABLE_PLAN)
.paramStringIn("schema_name", IDENT_MAX)
.paramStringIn("table_name", IDENT_MAX)
.externalName(GroupProtobufLoadablePlan.class.getCanonicalName());
// Query logging
aisb.procedure("query_log_set_enabled")
.language("java", Routine.CallingConvention.JAVA)
.paramBooleanIn("enabled")
.externalName(QueryLoggingRoutines.class.getCanonicalName(), "setEnabled");
aisb.procedure("query_log_is_enabled")
.language("java", Routine.CallingConvention.JAVA)
.returnBoolean("is_enabled")
.externalName(QueryLoggingRoutines.class.getCanonicalName(), "isEnabled");
aisb.procedure("query_log_set_file")
.language("java", Routine.CallingConvention.JAVA)
.paramStringIn("filename", PATH_MAX)
.externalName(QueryLoggingRoutines.class.getCanonicalName(), "setFile");
aisb.procedure("query_log_get_file")
.language("java", Routine.CallingConvention.JAVA)
.returnString("filename", PATH_MAX)
.externalName(QueryLoggingRoutines.class.getCanonicalName(), "getFile");
aisb.procedure("query_log_set_millis")
.language("java", Routine.CallingConvention.JAVA)
.paramLongIn("milliseconds")
.externalName(QueryLoggingRoutines.class.getCanonicalName(), "setMillis");
aisb.procedure("query_log_get_millis")
.language("java", Routine.CallingConvention.JAVA)
.returnLong("milliseconds")
.externalName(QueryLoggingRoutines.class.getCanonicalName(), "getMillis");
aisb.defaultSchema(TableName.SQLJ_SCHEMA);
aisb.procedure("install_jar")
.language("java", Routine.CallingConvention.JAVA)
.paramStringIn("url", PATH_MAX)
.paramStringIn("jar", PATH_MAX)
.paramLongIn("deploy")
.externalName(SQLJJarRoutines.class.getCanonicalName(), "install");
aisb.procedure("replace_jar")
.language("java", Routine.CallingConvention.JAVA)
.paramStringIn("url", PATH_MAX)
.paramStringIn("jar", PATH_MAX)
.externalName(SQLJJarRoutines.class.getCanonicalName(), "replace");
aisb.procedure("remove_jar")
.language("java", Routine.CallingConvention.JAVA)
.paramStringIn("jar", PATH_MAX)
.paramLongIn("undeploy")
.externalName(SQLJJarRoutines.class.getCanonicalName(), "remove");
Collection<Routine> procs = aisb.ais().getRoutines().values();
for (Routine proc : procs) {
schemaManager.registerSystemRoutine(proc);
}
}