id
stringlengths
7
14
test_class
dict
test_case
dict
focal_class
dict
focal_method
dict
repository
dict
146510094_167
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "filter", "modifier": "private", "original_string": "private SecurityServletFilter filter;", "type": "SecurityServletFilter", "var_name": "filter" }, { "declarator": "mockServletRequest", "modifier": "@Mock private", "original_string": "@Mock private HttpServletRequest mockServletRequest;", "type": "HttpServletRequest", "var_name": "mockServletRequest" }, { "declarator": "mockServletResponse", "modifier": "@Mock private", "original_string": "@Mock private ServletResponse mockServletResponse;", "type": "ServletResponse", "var_name": "mockServletResponse" }, { "declarator": "mockFilterChain", "modifier": "@Mock private", "original_string": "@Mock private FilterChain mockFilterChain;", "type": "FilterChain", "var_name": "mockFilterChain" }, { "declarator": "mockConfigurationFactory", "modifier": "@Mock private", "original_string": "@Mock private ConfigurationFactory mockConfigurationFactory;", "type": "ConfigurationFactory", "var_name": "mockConfigurationFactory" }, { "declarator": "mockSecureLogin", "modifier": "@Mock private", "original_string": "@Mock private SecureLogin mockSecureLogin;", "type": "SecureLogin", "var_name": "mockSecureLogin" }, { "declarator": "mockUGICache", "modifier": "@Mock private", "original_string": "@Mock private UGICache mockUGICache;", "type": "UGICache", "var_name": "mockUGICache" }, { "declarator": "mockConfiguration", "modifier": "@Mock private", "original_string": "@Mock private Configuration mockConfiguration;", "type": "Configuration", "var_name": "mockConfiguration" }, { "declarator": "mockLoginUGI", "modifier": "@Mock private", "original_string": "@Mock private UserGroupInformation mockLoginUGI;", "type": "UserGroupInformation", "var_name": "mockLoginUGI" }, { "declarator": "mockProxyUGI", "modifier": "@Mock private", "original_string": "@Mock private UserGroupInformation mockProxyUGI;", "type": "UserGroupInformation", "var_name": "mockProxyUGI" }, { "declarator": "session", "modifier": "@Captor private", "original_string": "@Captor private ArgumentCaptor<SessionId> session;", "type": "ArgumentCaptor<SessionId>", "var_name": "session" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/servlet/SecurityServletFilterTest.java", "identifier": "SecurityServletFilterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void tellsTheUGICacheToCleanItselfOnTheLastCallForASegment() throws Exception {\n when(mockServletRequest.getHeader(\"X-GP-LAST-FRAGMENT\")).thenReturn(\"true\");\n expectScenario(false, false, false);\n filter.doFilter(mockServletRequest, mockServletResponse, mockFilterChain);\n verifyScenario(\"login-user\", false);\n verify(mockUGICache).release(any(SessionId.class), eq(true));\n }", "class_method_signature": "SecurityServletFilterTest.tellsTheUGICacheToCleanItselfOnTheLastCallForASegment()", "constructor": false, "full_signature": "@Test public void tellsTheUGICacheToCleanItselfOnTheLastCallForASegment()", "identifier": "tellsTheUGICacheToCleanItselfOnTheLastCallForASegment", "invocations": [ "thenReturn", "when", "getHeader", "expectScenario", "doFilter", "verifyScenario", "release", "verify", "any", "eq" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void tellsTheUGICacheToCleanItselfOnTheLastCallForASegment()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SecurityServletFilter.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SecurityServletFilter.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "CONFIG_HEADER = \"X-GP-OPTIONS-CONFIG\"", "modifier": "private static final", "original_string": "private static final String CONFIG_HEADER = \"X-GP-OPTIONS-CONFIG\";", "type": "String", "var_name": "CONFIG_HEADER" }, { "declarator": "USER_HEADER = \"X-GP-USER\"", "modifier": "private static final", "original_string": "private static final String USER_HEADER = \"X-GP-USER\";", "type": "String", "var_name": "USER_HEADER" }, { "declarator": "SEGMENT_ID_HEADER = \"X-GP-SEGMENT-ID\"", "modifier": "private static final", "original_string": "private static final String SEGMENT_ID_HEADER = \"X-GP-SEGMENT-ID\";", "type": "String", "var_name": "SEGMENT_ID_HEADER" }, { "declarator": "SERVER_HEADER = \"X-GP-OPTIONS-SERVER\"", "modifier": "private static final", "original_string": "private static final String SERVER_HEADER = \"X-GP-OPTIONS-SERVER\";", "type": "String", "var_name": "SERVER_HEADER" }, { "declarator": "TRANSACTION_ID_HEADER = \"X-GP-XID\"", "modifier": "private static final", "original_string": "private static final String TRANSACTION_ID_HEADER = \"X-GP-XID\";", "type": "String", "var_name": "TRANSACTION_ID_HEADER" }, { "declarator": "LAST_FRAGMENT_HEADER = \"X-GP-LAST-FRAGMENT\"", "modifier": "private static final", "original_string": "private static final String LAST_FRAGMENT_HEADER = \"X-GP-LAST-FRAGMENT\";", "type": "String", "var_name": "LAST_FRAGMENT_HEADER" }, { "declarator": "MISSING_HEADER_ERROR = \"Header %s is missing in the request\"", "modifier": "private static final", "original_string": "private static final String MISSING_HEADER_ERROR = \"Header %s is missing in the request\";", "type": "String", "var_name": "MISSING_HEADER_ERROR" }, { "declarator": "EMPTY_HEADER_ERROR = \"Header %s is empty in the request\"", "modifier": "private static final", "original_string": "private static final String EMPTY_HEADER_ERROR = \"Header %s is empty in the request\";", "type": "String", "var_name": "EMPTY_HEADER_ERROR" }, { "declarator": "ugiCache", "modifier": "private", "original_string": "private UGICache ugiCache;", "type": "UGICache", "var_name": "ugiCache" }, { "declarator": "configurationFactory", "modifier": "private final", "original_string": "private final ConfigurationFactory configurationFactory;", "type": "ConfigurationFactory", "var_name": "configurationFactory" }, { "declarator": "secureLogin", "modifier": "private final", "original_string": "private final SecureLogin secureLogin;", "type": "SecureLogin", "var_name": "secureLogin" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/servlet/SecurityServletFilter.java", "identifier": "SecurityServletFilter", "interfaces": "implements Filter", "methods": [ { "class_method_signature": "SecurityServletFilter.SecurityServletFilter()", "constructor": true, "full_signature": "public SecurityServletFilter()", "identifier": "SecurityServletFilter", "modifiers": "public", "parameters": "()", "return": "", "signature": " SecurityServletFilter()", "testcase": false }, { "class_method_signature": "SecurityServletFilter.SecurityServletFilter(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "constructor": true, "full_signature": " SecurityServletFilter(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "identifier": "SecurityServletFilter", "modifiers": "", "parameters": "(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "return": "", "signature": " SecurityServletFilter(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.init(FilterConfig filterConfig)", "constructor": false, "full_signature": "@Override public void init(FilterConfig filterConfig)", "identifier": "init", "modifiers": "@Override public", "parameters": "(FilterConfig filterConfig)", "return": "void", "signature": "void init(FilterConfig filterConfig)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "constructor": false, "full_signature": "@Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "identifier": "doFilter", "modifiers": "@Override public", "parameters": "(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "return": "void", "signature": "void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.destroy()", "constructor": false, "full_signature": "@Override public void destroy()", "identifier": "destroy", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void destroy()", "testcase": false }, { "class_method_signature": "SecurityServletFilter.getHeaderValueInt(ServletRequest request, String headerKey, boolean required)", "constructor": false, "full_signature": "private Integer getHeaderValueInt(ServletRequest request, String headerKey, boolean required)", "identifier": "getHeaderValueInt", "modifiers": "private", "parameters": "(ServletRequest request, String headerKey, boolean required)", "return": "Integer", "signature": "Integer getHeaderValueInt(ServletRequest request, String headerKey, boolean required)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.getHeaderValue(ServletRequest request, String headerKey, boolean required)", "constructor": false, "full_signature": "private String getHeaderValue(ServletRequest request, String headerKey, boolean required)", "identifier": "getHeaderValue", "modifiers": "private", "parameters": "(ServletRequest request, String headerKey, boolean required)", "return": "String", "signature": "String getHeaderValue(ServletRequest request, String headerKey, boolean required)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.getHeaderValueBoolean(ServletRequest request, String headerKey, boolean required)", "constructor": false, "full_signature": "private boolean getHeaderValueBoolean(ServletRequest request, String headerKey, boolean required)", "identifier": "getHeaderValueBoolean", "modifiers": "private", "parameters": "(ServletRequest request, String headerKey, boolean required)", "return": "boolean", "signature": "boolean getHeaderValueBoolean(ServletRequest request, String headerKey, boolean required)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)\n throws IOException, ServletException {\n\n // retrieve user header and make sure header is present and is not empty\n final String gpdbUser = getHeaderValue(request, USER_HEADER, true);\n final String transactionId = getHeaderValue(request, TRANSACTION_ID_HEADER, true);\n final Integer segmentId = getHeaderValueInt(request, SEGMENT_ID_HEADER, true);\n final boolean lastCallForSegment = getHeaderValueBoolean(request, LAST_FRAGMENT_HEADER, false);\n\n final String serverName = StringUtils.defaultIfBlank(getHeaderValue(request, SERVER_HEADER, false), \"default\");\n final String configDirectory = StringUtils.defaultIfBlank(getHeaderValue(request, CONFIG_HEADER, false), serverName);\n final Configuration configuration = configurationFactory.initConfiguration(configDirectory, serverName, gpdbUser, null);\n final boolean isUserImpersonation = secureLogin.isUserImpersonationEnabled(configuration);\n final boolean isSecurityEnabled = Utilities.isSecurityEnabled(configuration);\n\n // Establish the UGI for the login user or the Kerberos principal for the given server, if applicable\n UserGroupInformation loginUser = secureLogin.getLoginUser(serverName, configDirectory, configuration);\n\n String serviceUser = loginUser.getUserName();\n\n if (!isUserImpersonation && isSecurityEnabled) {\n // When impersonation is disabled and security is enabled\n // we check whether the pxf.service.user.name property was provided\n // and if provided we use the value as the remote user instead of\n // the principal defined in pxf.service.kerberos.principal. However,\n // the principal will need to have proxy privileges on hadoop.\n String pxfServiceUserName = configuration.get(SecureLogin.CONFIG_KEY_SERVICE_USER_NAME);\n if (StringUtils.isNotBlank(pxfServiceUserName)) {\n serviceUser = pxfServiceUserName;\n }\n }\n\n String remoteUser = (isUserImpersonation ? gpdbUser : serviceUser);\n\n SessionId session = new SessionId(\n segmentId,\n transactionId,\n remoteUser,\n serverName,\n isSecurityEnabled,\n loginUser);\n\n final String serviceUserName = serviceUser;\n\n // Prepare privileged action to run on behalf of proxy user\n PrivilegedExceptionAction<Boolean> action = () -> {\n LOG.debug(\"Performing request for gpdb_user = {} as [remote_user = {} service_user = {} login_user ={}] with{} impersonation\",\n gpdbUser, remoteUser, serviceUserName, loginUser.getUserName(), isUserImpersonation ? \"\" : \"out\");\n chain.doFilter(request, response);\n return true;\n };\n\n boolean exceptionDetected = false;\n try {\n // Retrieve proxy user UGI from the UGI of the logged in user\n UserGroupInformation userGroupInformation = ugiCache\n .getUserGroupInformation(session, isUserImpersonation);\n\n LOG.debug(\"Retrieved proxy user {} for server {} and session {}\", userGroupInformation, serverName, session);\n\n // Execute the servlet chain as that user\n userGroupInformation.doAs(action);\n } catch (UndeclaredThrowableException ute) {\n exceptionDetected = true;\n // unwrap the real exception thrown by the action\n throw new ServletException(ute.getCause());\n } catch (InterruptedException ie) {\n exceptionDetected = true;\n throw new ServletException(ie);\n } finally {\n // Optimization to cleanup the cache if it is the last fragment\n boolean releaseUgi = lastCallForSegment || exceptionDetected;\n LOG.debug(\"Releasing UGI from cache for session: {}. {}\",\n session, exceptionDetected\n ? \" Exception while processing\"\n : (lastCallForSegment ? \" Processed last fragment for segment\" : \"\"));\n try {\n ugiCache.release(session, releaseUgi);\n } catch (Throwable t) {\n LOG.error(\"Error releasing UGI from cache for session: {}\", session, t);\n }\n if (releaseUgi) {\n LOG.info(\"Finished processing {}\", session);\n }\n }\n }", "class_method_signature": "SecurityServletFilter.doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "constructor": false, "full_signature": "@Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "identifier": "doFilter", "invocations": [ "getHeaderValue", "getHeaderValue", "getHeaderValueInt", "getHeaderValueBoolean", "defaultIfBlank", "getHeaderValue", "defaultIfBlank", "getHeaderValue", "initConfiguration", "isUserImpersonationEnabled", "isSecurityEnabled", "getLoginUser", "getUserName", "get", "isNotBlank", "debug", "getUserName", "doFilter", "getUserGroupInformation", "debug", "doAs", "getCause", "debug", "release", "error", "info" ], "modifiers": "@Override public", "parameters": "(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "return": "void", "signature": "void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_171
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/profile/ProfilesConfTest.java", "identifier": "ProfilesConfTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void undefinedProfile() {\n expectedException.expect(ProfileConfException.class);\n expectedException.expectMessage(\"UndefinedProfile is not defined in profile/undefinedProfile/pxf-profiles.xml\");\n\n ProfilesConf profilesConf = getProfilesConf(\"undefinedProfile\");\n profilesConf.getPlugins(\"UndefinedProfile\");\n }", "class_method_signature": "ProfilesConfTest.undefinedProfile()", "constructor": false, "full_signature": "@Test public void undefinedProfile()", "identifier": "undefinedProfile", "invocations": [ "expect", "expectMessage", "getProfilesConf", "getPlugins" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void undefinedProfile()", "testcase": true }
{ "fields": [ { "declarator": "EXTERNAL_PROFILES = \"pxf-profiles.xml\"", "modifier": "private final static", "original_string": "private final static String EXTERNAL_PROFILES = \"pxf-profiles.xml\";", "type": "String", "var_name": "EXTERNAL_PROFILES" }, { "declarator": "INTERNAL_PROFILES = \"pxf-profiles-default.xml\"", "modifier": "private final static", "original_string": "private final static String INTERNAL_PROFILES = \"pxf-profiles-default.xml\";", "type": "String", "var_name": "INTERNAL_PROFILES" }, { "declarator": "LOG = LoggerFactory.getLogger(ProfilesConf.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(ProfilesConf.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "INSTANCE = new ProfilesConf()", "modifier": "private final static", "original_string": "private final static ProfilesConf INSTANCE = new ProfilesConf();", "type": "ProfilesConf", "var_name": "INSTANCE" }, { "declarator": "externalProfilesFilename", "modifier": "private final", "original_string": "private final String externalProfilesFilename;", "type": "String", "var_name": "externalProfilesFilename" }, { "declarator": "profilesMap", "modifier": "private", "original_string": "private Map<String, Profile> profilesMap;", "type": "Map<String, Profile>", "var_name": "profilesMap" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/profile/ProfilesConf.java", "identifier": "ProfilesConf", "interfaces": "implements PluginConf", "methods": [ { "class_method_signature": "ProfilesConf.ProfilesConf()", "constructor": true, "full_signature": "private ProfilesConf()", "identifier": "ProfilesConf", "modifiers": "private", "parameters": "()", "return": "", "signature": " ProfilesConf()", "testcase": false }, { "class_method_signature": "ProfilesConf.ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "constructor": true, "full_signature": " ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "identifier": "ProfilesConf", "modifiers": "", "parameters": "(String internalProfilesFilename, String externalProfilesFilename)", "return": "", "signature": " ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "testcase": false }, { "class_method_signature": "ProfilesConf.getInstance()", "constructor": false, "full_signature": "public static ProfilesConf getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "ProfilesConf", "signature": "ProfilesConf getInstance()", "testcase": false }, { "class_method_signature": "ProfilesConf.getOptionMappings(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getOptionMappings(String profileName)", "identifier": "getOptionMappings", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getOptionMappings(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getPlugins(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getPlugins(String profileName)", "identifier": "getPlugins", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getPlugins(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getProtocol(String profileName)", "constructor": false, "full_signature": "@Override public String getProtocol(String profileName)", "identifier": "getProtocol", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "String", "signature": "String getProtocol(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getHandler(String profileName)", "constructor": false, "full_signature": "@Override public String getHandler(String profileName)", "identifier": "getHandler", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "String", "signature": "String getHandler(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getProfile(String profileName)", "constructor": false, "full_signature": "private Profile getProfile(String profileName)", "identifier": "getProfile", "modifiers": "private", "parameters": "(String profileName)", "return": "Profile", "signature": "Profile getProfile(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.loadConf(String fileName, boolean isMandatory)", "constructor": false, "full_signature": "private void loadConf(String fileName, boolean isMandatory)", "identifier": "loadConf", "modifiers": "private", "parameters": "(String fileName, boolean isMandatory)", "return": "void", "signature": "void loadConf(String fileName, boolean isMandatory)", "testcase": false }, { "class_method_signature": "ProfilesConf.getClassLoader()", "constructor": false, "full_signature": "private ClassLoader getClassLoader()", "identifier": "getClassLoader", "modifiers": "private", "parameters": "()", "return": "ClassLoader", "signature": "ClassLoader getClassLoader()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public Map<String, String> getPlugins(String profileName) {\n Profile profile = getProfile(profileName);\n Map<String, String> result = profile.getPluginsMap();\n if (result.isEmpty()) {\n throw new ProfileConfException(NO_PLUGINS_IN_PROFILE_DEF, profileName, externalProfilesFilename);\n }\n return result;\n }", "class_method_signature": "ProfilesConf.getPlugins(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getPlugins(String profileName)", "identifier": "getPlugins", "invocations": [ "getProfile", "getPluginsMap", "isEmpty" ], "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getPlugins(String profileName)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_258
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS() {\n avroUtilities = new AvroUtilities((file) -> dontFindLocalFile());\n context.setRequestType(RequestContext.RequestType.WRITE_BRIDGE);\n context.addOption(\"SCHEMA\", avroDirectory + \"user-provided.avsc\");\n context.setDataSource(avroDirectory);\n\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifySchema(schema, \"user_provided_schema\");\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS()", "identifier": "testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS", "invocations": [ "dontFindLocalFile", "setRequestType", "addOption", "setDataSource", "obtainSchema", "verifySchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_95
{ "fields": [ { "declarator": "PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_USER_IMPERSONATION" }, { "declarator": "PROPERTY_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\";", "type": "String", "var_name": "PROPERTY_KEY_SERVICE_PRINCIPAL" }, { "declarator": "PROPERTY_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\";", "type": "String", "var_name": "PROPERTY_KEY_SERVICE_KEYTAB" }, { "declarator": "PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_KDC" }, { "declarator": "PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_REALM" }, { "declarator": "userImpersonationEnabled", "modifier": "private static", "original_string": "private static String userImpersonationEnabled;", "type": "String", "var_name": "userImpersonationEnabled" }, { "declarator": "kerberosPrincipal", "modifier": "private static", "original_string": "private static String kerberosPrincipal;", "type": "String", "var_name": "kerberosPrincipal" }, { "declarator": "kerberosKeytab", "modifier": "private static", "original_string": "private static String kerberosKeytab;", "type": "String", "var_name": "kerberosKeytab" }, { "declarator": "kdcDefault", "modifier": "private static", "original_string": "private static String kdcDefault;", "type": "String", "var_name": "kdcDefault" }, { "declarator": "realmDefault", "modifier": "private static", "original_string": "private static String realmDefault;", "type": "String", "var_name": "realmDefault" }, { "declarator": "hostname", "modifier": "private static final", "original_string": "private static final String hostname;", "type": "String", "var_name": "hostname" }, { "declarator": "RESOLVED_PRINCIPAL", "modifier": "private static final", "original_string": "private static final String RESOLVED_PRINCIPAL;", "type": "String", "var_name": "RESOLVED_PRINCIPAL" }, { "declarator": "secureLogin", "modifier": "private", "original_string": "private SecureLogin secureLogin;", "type": "SecureLogin", "var_name": "secureLogin" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "expectedLoginSession", "modifier": "private", "original_string": "private LoginSession expectedLoginSession;", "type": "LoginSession", "var_name": "expectedLoginSession" }, { "declarator": "expectedUGI", "modifier": "private", "original_string": "private UserGroupInformation expectedUGI;", "type": "UserGroupInformation", "var_name": "expectedUGI" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/security/SecureLoginTest.java", "identifier": "SecureLoginTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGlobalImpersonationPropertyEmpty() {\n System.setProperty(PROPERTY_KEY_USER_IMPERSONATION, \"\");\n assertFalse(secureLogin.isUserImpersonationEnabled(configuration));\n }", "class_method_signature": "SecureLoginTest.testGlobalImpersonationPropertyEmpty()", "constructor": false, "full_signature": "@Test public void testGlobalImpersonationPropertyEmpty()", "identifier": "testGlobalImpersonationPropertyEmpty", "invocations": [ "setProperty", "assertFalse", "isUserImpersonationEnabled" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGlobalImpersonationPropertyEmpty()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SecureLogin.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SecureLogin.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "CONFIG_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_PRINCIPAL" }, { "declarator": "CONFIG_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_KEYTAB" }, { "declarator": "CONFIG_KEY_SERVICE_USER_IMPERSONATION = \"pxf.service.user.impersonation\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_USER_IMPERSONATION = \"pxf.service.user.impersonation\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_USER_IMPERSONATION" }, { "declarator": "CONFIG_KEY_SERVICE_USER_NAME = \"pxf.service.user.name\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_USER_NAME = \"pxf.service.user.name\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_USER_NAME" }, { "declarator": "PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_USER_IMPERSONATION" }, { "declarator": "loginMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, LoginSession> loginMap = new HashMap<>();", "type": "Map<String, LoginSession>", "var_name": "loginMap" }, { "declarator": "instance = new SecureLogin()", "modifier": "private static final", "original_string": "private static final SecureLogin instance = new SecureLogin();", "type": "SecureLogin", "var_name": "instance" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/security/SecureLogin.java", "identifier": "SecureLogin", "interfaces": "", "methods": [ { "class_method_signature": "SecureLogin.SecureLogin()", "constructor": true, "full_signature": "private SecureLogin()", "identifier": "SecureLogin", "modifiers": "private", "parameters": "()", "return": "", "signature": " SecureLogin()", "testcase": false }, { "class_method_signature": "SecureLogin.getInstance()", "constructor": false, "full_signature": "public static SecureLogin getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "SecureLogin", "signature": "SecureLogin getInstance()", "testcase": false }, { "class_method_signature": "SecureLogin.getLoginUser(RequestContext context, Configuration configuration)", "constructor": false, "full_signature": "public UserGroupInformation getLoginUser(RequestContext context, Configuration configuration)", "identifier": "getLoginUser", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration)", "return": "UserGroupInformation", "signature": "UserGroupInformation getLoginUser(RequestContext context, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getLoginUser(String serverName, String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "public UserGroupInformation getLoginUser(String serverName, String configDirectory, Configuration configuration)", "identifier": "getLoginUser", "modifiers": "public", "parameters": "(String serverName, String configDirectory, Configuration configuration)", "return": "UserGroupInformation", "signature": "UserGroupInformation getLoginUser(String serverName, String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.login(String serverName, String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "private LoginSession login(String serverName, String configDirectory, Configuration configuration)", "identifier": "login", "modifiers": "private", "parameters": "(String serverName, String configDirectory, Configuration configuration)", "return": "LoginSession", "signature": "LoginSession login(String serverName, String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.isUserImpersonationEnabled(Configuration configuration)", "constructor": false, "full_signature": "public boolean isUserImpersonationEnabled(Configuration configuration)", "identifier": "isUserImpersonationEnabled", "modifiers": "public", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isUserImpersonationEnabled(Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "private LoginSession getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "identifier": "getServerLoginSession", "modifiers": "private", "parameters": "(final String serverName, final String configDirectory, Configuration configuration)", "return": "LoginSession", "signature": "LoginSession getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServicePrincipal(String serverName, Configuration configuration)", "constructor": false, "full_signature": " String getServicePrincipal(String serverName, Configuration configuration)", "identifier": "getServicePrincipal", "modifiers": "", "parameters": "(String serverName, Configuration configuration)", "return": "String", "signature": "String getServicePrincipal(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServiceKeytab(String serverName, Configuration configuration)", "constructor": false, "full_signature": " String getServiceKeytab(String serverName, Configuration configuration)", "identifier": "getServiceKeytab", "modifiers": "", "parameters": "(String serverName, Configuration configuration)", "return": "String", "signature": "String getServiceKeytab(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getLocalHostName(@Nullable Configuration conf)", "constructor": false, "full_signature": "private String getLocalHostName(@Nullable Configuration conf)", "identifier": "getLocalHostName", "modifiers": "private", "parameters": "(@Nullable Configuration conf)", "return": "String", "signature": "String getLocalHostName(@Nullable Configuration conf)", "testcase": false }, { "class_method_signature": "SecureLogin.reset()", "constructor": false, "full_signature": "static void reset()", "identifier": "reset", "modifiers": "static", "parameters": "()", "return": "void", "signature": "void reset()", "testcase": false }, { "class_method_signature": "SecureLogin.getCache()", "constructor": false, "full_signature": "static Map<String, LoginSession> getCache()", "identifier": "getCache", "modifiers": "static", "parameters": "()", "return": "Map<String, LoginSession>", "signature": "Map<String, LoginSession> getCache()", "testcase": false }, { "class_method_signature": "SecureLogin.addToCache(String server, LoginSession session)", "constructor": false, "full_signature": "static void addToCache(String server, LoginSession session)", "identifier": "addToCache", "modifiers": "static", "parameters": "(String server, LoginSession session)", "return": "void", "signature": "void addToCache(String server, LoginSession session)", "testcase": false } ], "superclass": "" }
{ "body": "public boolean isUserImpersonationEnabled(Configuration configuration) {\n String valueFromUserImpersonationOnServer = configuration.get(SecureLogin.CONFIG_KEY_SERVICE_USER_IMPERSONATION, System.getProperty(PROPERTY_KEY_USER_IMPERSONATION, \"false\"));\n return StringUtils.equalsIgnoreCase(valueFromUserImpersonationOnServer, \"true\");\n }", "class_method_signature": "SecureLogin.isUserImpersonationEnabled(Configuration configuration)", "constructor": false, "full_signature": "public boolean isUserImpersonationEnabled(Configuration configuration)", "identifier": "isUserImpersonationEnabled", "invocations": [ "get", "getProperty", "equalsIgnoreCase" ], "modifiers": "public", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isUserImpersonationEnabled(Configuration configuration)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_126
{ "fields": [ { "declarator": "MINUTES = 60 * 1000L", "modifier": "private static final", "original_string": "private static final long MINUTES = 60 * 1000L;", "type": "long", "var_name": "MINUTES" }, { "declarator": "provider = null", "modifier": "private", "original_string": "private UGIProvider provider = null;", "type": "UGIProvider", "var_name": "provider" }, { "declarator": "session = null", "modifier": "private", "original_string": "private SessionId session = null;", "type": "SessionId", "var_name": "session" }, { "declarator": "cache = null", "modifier": "private", "original_string": "private UGICache cache = null;", "type": "UGICache", "var_name": "cache" }, { "declarator": "fakeTicker", "modifier": "private", "original_string": "private FakeTicker fakeTicker;", "type": "FakeTicker", "var_name": "fakeTicker" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/UGICacheTest.java", "identifier": "UGICacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getSameProxyUGITwiceUsesCache() throws Exception {\n UserGroupInformation ugi1 = cache.getUserGroupInformation(session, true);\n UserGroupInformation ugi2 = cache.getUserGroupInformation(session, true);\n assertEquals(ugi1, ugi2);\n verify(provider, times(1)).createProxyUGI(\"the-user\", UserGroupInformation.getLoginUser());\n assertCacheSize(1);\n }", "class_method_signature": "UGICacheTest.getSameProxyUGITwiceUsesCache()", "constructor": false, "full_signature": "@Test public void getSameProxyUGITwiceUsesCache()", "identifier": "getSameProxyUGITwiceUsesCache", "invocations": [ "getUserGroupInformation", "getUserGroupInformation", "assertEquals", "createProxyUGI", "verify", "times", "getLoginUser", "assertCacheSize" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getSameProxyUGITwiceUsesCache()", "testcase": true }
{ "fields": [ { "declarator": "NANOS_PER_MILLIS = 1000000", "modifier": "static final", "original_string": "static final int NANOS_PER_MILLIS = 1000000;", "type": "int", "var_name": "NANOS_PER_MILLIS" }, { "declarator": "UGI_CACHE_EXPIRY = 15 * 60 * 1000L", "modifier": "static final", "original_string": "static final long UGI_CACHE_EXPIRY = 15 * 60 * 1000L;", "type": "long", "var_name": "UGI_CACHE_EXPIRY" }, { "declarator": "LOG = LoggerFactory.getLogger(UGICache.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(UGICache.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "cache = new ConcurrentHashMap<>()", "modifier": "private final", "original_string": "private final Map<SessionId, Entry> cache = new ConcurrentHashMap<>();", "type": "Map<SessionId, Entry>", "var_name": "cache" }, { "declarator": "expirationQueueMap = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<Integer, DelayQueue<Entry>> expirationQueueMap = new HashMap<>();", "type": "Map<Integer, DelayQueue<Entry>>", "var_name": "expirationQueueMap" }, { "declarator": "ugiProvider", "modifier": "private final", "original_string": "private final UGIProvider ugiProvider;", "type": "UGIProvider", "var_name": "ugiProvider" }, { "declarator": "ticker", "modifier": "private final", "original_string": "private final Ticker ticker;", "type": "Ticker", "var_name": "ticker" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/UGICache.java", "identifier": "UGICache", "interfaces": "", "methods": [ { "class_method_signature": "UGICache.UGICache(UGIProvider provider, Ticker ticker)", "constructor": true, "full_signature": " UGICache(UGIProvider provider, Ticker ticker)", "identifier": "UGICache", "modifiers": "", "parameters": "(UGIProvider provider, Ticker ticker)", "return": "", "signature": " UGICache(UGIProvider provider, Ticker ticker)", "testcase": false }, { "class_method_signature": "UGICache.UGICache()", "constructor": true, "full_signature": "public UGICache()", "identifier": "UGICache", "modifiers": "public", "parameters": "()", "return": "", "signature": " UGICache()", "testcase": false }, { "class_method_signature": "UGICache.getUserGroupInformation(SessionId session, boolean isProxyUser)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "identifier": "getUserGroupInformation", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean isProxyUser)", "return": "UserGroupInformation", "signature": "UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "testcase": false }, { "class_method_signature": "UGICache.release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "identifier": "release", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean cleanImmediatelyIfNoRefs)", "return": "void", "signature": "void release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "testcase": false }, { "class_method_signature": "UGICache.size()", "constructor": false, "full_signature": " int size()", "identifier": "size", "modifiers": "", "parameters": "()", "return": "int", "signature": "int size()", "testcase": false }, { "class_method_signature": "UGICache.allQueuesSize()", "constructor": false, "full_signature": " int allQueuesSize()", "identifier": "allQueuesSize", "modifiers": "", "parameters": "()", "return": "int", "signature": "int allQueuesSize()", "testcase": false }, { "class_method_signature": "UGICache.contains(SessionId session)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") boolean contains(SessionId session)", "identifier": "contains", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\")", "parameters": "(SessionId session)", "return": "boolean", "signature": "boolean contains(SessionId session)", "testcase": false }, { "class_method_signature": "UGICache.getExpirationQueue(Integer segmentId)", "constructor": false, "full_signature": "private DelayQueue<Entry> getExpirationQueue(Integer segmentId)", "identifier": "getExpirationQueue", "modifiers": "private", "parameters": "(Integer segmentId)", "return": "DelayQueue<Entry>", "signature": "DelayQueue<Entry> getExpirationQueue(Integer segmentId)", "testcase": false }, { "class_method_signature": "UGICache.cleanup(DelayQueue<Entry> expirationQueue)", "constructor": false, "full_signature": "private void cleanup(DelayQueue<Entry> expirationQueue)", "identifier": "cleanup", "modifiers": "private", "parameters": "(DelayQueue<Entry> expirationQueue)", "return": "void", "signature": "void cleanup(DelayQueue<Entry> expirationQueue)", "testcase": false }, { "class_method_signature": "UGICache.closeUGI(Entry expiredUGI)", "constructor": false, "full_signature": "private void closeUGI(Entry expiredUGI)", "identifier": "closeUGI", "modifiers": "private", "parameters": "(Entry expiredUGI)", "return": "void", "signature": "void closeUGI(Entry expiredUGI)", "testcase": false } ], "superclass": "" }
{ "body": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\")\n public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser) throws IOException {\n Integer segmentId = session.getSegmentId();\n String user = session.getUser();\n DelayQueue<Entry> delayQueue = getExpirationQueue(segmentId);\n synchronized (delayQueue) {\n // Use the opportunity to cleanup any expired entries\n cleanup(delayQueue);\n Entry entry = cache.get(session);\n if (entry == null) {\n\n UserGroupInformation ugi;\n if (isProxyUser) {\n LOG.debug(\"{} Creating proxy user = {}\", session, user);\n ugi = ugiProvider.createProxyUGI(user, session.getLoginUser());\n } else {\n LOG.debug(\"{} Creating remote user = {}\", session, user);\n ugi = ugiProvider.createRemoteUser(user, session);\n }\n entry = new Entry(ticker, ugi, session);\n delayQueue.offer(entry);\n cache.put(session, entry);\n }\n entry.incrementRefCount();\n return entry.getUGI();\n }\n }", "class_method_signature": "UGICache.getUserGroupInformation(SessionId session, boolean isProxyUser)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "identifier": "getUserGroupInformation", "invocations": [ "getSegmentId", "getUser", "getExpirationQueue", "cleanup", "get", "debug", "createProxyUGI", "getLoginUser", "debug", "createRemoteUser", "offer", "put", "incrementRefCount", "getUGI" ], "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean isProxyUser)", "return": "UserGroupInformation", "signature": "UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_331
{ "fields": [ { "declarator": "SQL = \"SELECT id, cdate, amt, grade, b FROM sales\"", "modifier": "private static final", "original_string": "private static final String SQL = \"SELECT id, cdate, amt, grade, b FROM sales\";", "type": "String", "var_name": "SQL" }, { "declarator": "NAMED_QUERY = \"SELECT a, b FROM c\"", "modifier": "public static final", "original_string": "public static final String NAMED_QUERY = \"SELECT a, b FROM c\";", "type": "String", "var_name": "NAMED_QUERY" }, { "declarator": "NAMED_QUERY_WHERE = \"SELECT a, b FROM c WHERE d = 'foo'\"", "modifier": "public static final", "original_string": "public static final String NAMED_QUERY_WHERE = \"SELECT a, b FROM c WHERE d = 'foo'\";", "type": "String", "var_name": "NAMED_QUERY_WHERE" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "mockMetaData", "modifier": "@Mock\n private", "original_string": "@Mock\n private DatabaseMetaData mockMetaData;", "type": "DatabaseMetaData", "var_name": "mockMetaData" }, { "declarator": "mockContext", "modifier": "@Mock\n private", "original_string": "@Mock\n private RequestContext mockContext;", "type": "RequestContext", "var_name": "mockContext" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/SQLQueryBuilderTest.java", "identifier": "SQLQueryBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSimpleNamedQuery() throws Exception {\n SQLQueryBuilder builder = new SQLQueryBuilder(context, mockMetaData, NAMED_QUERY_WHERE);\n String query = builder.buildSelectQuery();\n assertEquals(\"SELECT id, cdate, amt, grade, b FROM (SELECT a, b FROM c WHERE d = 'foo') pxfsubquery\", query);\n }", "class_method_signature": "SQLQueryBuilderTest.testSimpleNamedQuery()", "constructor": false, "full_signature": "@Test public void testSimpleNamedQuery()", "identifier": "testSimpleNamedQuery", "invocations": [ "buildSelectQuery", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testSimpleNamedQuery()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SQLQueryBuilder.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SQLQueryBuilder.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SUBQUERY_ALIAS_SUFFIX = \") pxfsubquery\"", "modifier": "private static final", "original_string": "private static final String SUBQUERY_ALIAS_SUFFIX = \") pxfsubquery\";", "type": "String", "var_name": "SUBQUERY_ALIAS_SUFFIX" }, { "declarator": "SUPPORTED_OPERATORS =\n EnumSet.of(\n Operator.LESS_THAN,\n Operator.GREATER_THAN,\n Operator.LESS_THAN_OR_EQUAL,\n Operator.GREATER_THAN_OR_EQUAL,\n Operator.EQUALS,\n Operator.LIKE,\n Operator.NOT_EQUALS,\n // TODO: In is not supported?\n // Operator.IN,\n Operator.IS_NULL,\n Operator.IS_NOT_NULL,\n Operator.NOOP,\n Operator.AND,\n Operator.NOT,\n Operator.OR\n )", "modifier": "private static final", "original_string": "private static final EnumSet<Operator> SUPPORTED_OPERATORS =\n EnumSet.of(\n Operator.LESS_THAN,\n Operator.GREATER_THAN,\n Operator.LESS_THAN_OR_EQUAL,\n Operator.GREATER_THAN_OR_EQUAL,\n Operator.EQUALS,\n Operator.LIKE,\n Operator.NOT_EQUALS,\n // TODO: In is not supported?\n // Operator.IN,\n Operator.IS_NULL,\n Operator.IS_NOT_NULL,\n Operator.NOOP,\n Operator.AND,\n Operator.NOT,\n Operator.OR\n );", "type": "EnumSet<Operator>", "var_name": "SUPPORTED_OPERATORS" }, { "declarator": "PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS)", "modifier": "private static final", "original_string": "private static final TreeVisitor PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS);", "type": "TreeVisitor", "var_name": "PRUNER" }, { "declarator": "TRAVERSER = new TreeTraverser()", "modifier": "private static final", "original_string": "private static final TreeTraverser TRAVERSER = new TreeTraverser();", "type": "TreeTraverser", "var_name": "TRAVERSER" }, { "declarator": "context", "modifier": "protected final", "original_string": "protected final RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "databaseMetaData", "modifier": "private final", "original_string": "private final DatabaseMetaData databaseMetaData;", "type": "DatabaseMetaData", "var_name": "databaseMetaData" }, { "declarator": "dbProduct", "modifier": "private final", "original_string": "private final DbProduct dbProduct;", "type": "DbProduct", "var_name": "dbProduct" }, { "declarator": "columns", "modifier": "private final", "original_string": "private final List<ColumnDescriptor> columns;", "type": "List<ColumnDescriptor>", "var_name": "columns" }, { "declarator": "source", "modifier": "private final", "original_string": "private final String source;", "type": "String", "var_name": "source" }, { "declarator": "quoteString", "modifier": "private", "original_string": "private String quoteString;", "type": "String", "var_name": "quoteString" }, { "declarator": "subQueryUsed = false", "modifier": "private", "original_string": "private boolean subQueryUsed = false;", "type": "boolean", "var_name": "subQueryUsed" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/SQLQueryBuilder.java", "identifier": "SQLQueryBuilder", "interfaces": "", "methods": [ { "class_method_signature": "SQLQueryBuilder.SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData)", "constructor": true, "full_signature": "public SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData)", "identifier": "SQLQueryBuilder", "modifiers": "public", "parameters": "(RequestContext context, DatabaseMetaData metaData)", "return": "", "signature": " SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData)", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery)", "constructor": true, "full_signature": "public SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery)", "identifier": "SQLQueryBuilder", "modifiers": "public", "parameters": "(RequestContext context, DatabaseMetaData metaData, String subQuery)", "return": "", "signature": " SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery)", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildSelectQuery()", "constructor": false, "full_signature": "public String buildSelectQuery()", "identifier": "buildSelectQuery", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String buildSelectQuery()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildInsertQuery()", "constructor": false, "full_signature": "public String buildInsertQuery()", "identifier": "buildInsertQuery", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String buildInsertQuery()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.autoSetQuoteString()", "constructor": false, "full_signature": "public void autoSetQuoteString()", "identifier": "autoSetQuoteString", "modifiers": "public", "parameters": "()", "return": "void", "signature": "void autoSetQuoteString()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.forceSetQuoteString()", "constructor": false, "full_signature": "public void forceSetQuoteString()", "identifier": "forceSetQuoteString", "modifiers": "public", "parameters": "()", "return": "void", "signature": "void forceSetQuoteString()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildColumnsQuery()", "constructor": false, "full_signature": "protected String buildColumnsQuery()", "identifier": "buildColumnsQuery", "modifiers": "protected", "parameters": "()", "return": "String", "signature": "String buildColumnsQuery()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.getSource()", "constructor": false, "full_signature": "protected String getSource()", "identifier": "getSource", "modifiers": "protected", "parameters": "()", "return": "String", "signature": "String getSource()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.getPredicateBuilder()", "constructor": false, "full_signature": "protected JdbcPredicateBuilder getPredicateBuilder()", "identifier": "getPredicateBuilder", "modifiers": "protected", "parameters": "()", "return": "JdbcPredicateBuilder", "signature": "JdbcPredicateBuilder getPredicateBuilder()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.getPruner()", "constructor": false, "full_signature": "protected TreeVisitor getPruner()", "identifier": "getPruner", "modifiers": "protected", "parameters": "()", "return": "TreeVisitor", "signature": "TreeVisitor getPruner()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildWhereSQL(StringBuilder query)", "constructor": false, "full_signature": "private void buildWhereSQL(StringBuilder query)", "identifier": "buildWhereSQL", "modifiers": "private", "parameters": "(StringBuilder query)", "return": "void", "signature": "void buildWhereSQL(StringBuilder query)", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "constructor": false, "full_signature": "public void buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "identifier": "buildFragmenterSql", "modifiers": "public", "parameters": "(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "return": "void", "signature": "void buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "testcase": false } ], "superclass": "" }
{ "body": "public String buildSelectQuery() {\n StringBuilder sb = new StringBuilder(\"SELECT \")\n .append(buildColumnsQuery())\n .append(\" FROM \")\n .append(getSource());\n\n // Insert regular WHERE constraints\n buildWhereSQL(sb);\n\n // Insert partition constraints\n buildFragmenterSql(context, dbProduct, quoteString, sb);\n\n return sb.toString();\n }", "class_method_signature": "SQLQueryBuilder.buildSelectQuery()", "constructor": false, "full_signature": "public String buildSelectQuery()", "identifier": "buildSelectQuery", "invocations": [ "append", "append", "append", "buildColumnsQuery", "getSource", "buildWhereSQL", "buildFragmenterSql", "toString" ], "modifiers": "public", "parameters": "()", "return": "String", "signature": "String buildSelectQuery()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_274
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "accessor", "modifier": "private", "original_string": "private SequenceFileAccessor accessor;", "type": "SequenceFileAccessor", "var_name": "accessor" }, { "declarator": "mockConfigurationFactory", "modifier": "private", "original_string": "private ConfigurationFactory mockConfigurationFactory;", "type": "ConfigurationFactory", "var_name": "mockConfigurationFactory" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/SequenceFileAccessorTest.java", "identifier": "SequenceFileAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void compressCodec() throws Exception {\n //using BZip2 as a valid example\n prepareTest(\"org.apache.hadoop.io.compress.BZip2Codec\", null);\n assertEquals(\".bz2\", accessor.getCodec().getDefaultExtension());\n }", "class_method_signature": "SequenceFileAccessorTest.compressCodec()", "constructor": false, "full_signature": "@Test public void compressCodec()", "identifier": "compressCodec", "invocations": [ "prepareTest", "assertEquals", "getDefaultExtension", "getCodec" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void compressCodec()", "testcase": true }
{ "fields": [ { "declarator": "fc", "modifier": "private", "original_string": "private FileContext fc;", "type": "FileContext", "var_name": "fc" }, { "declarator": "file", "modifier": "private", "original_string": "private Path file;", "type": "Path", "var_name": "file" }, { "declarator": "codec", "modifier": "private", "original_string": "private CompressionCodec codec;", "type": "CompressionCodec", "var_name": "codec" }, { "declarator": "compressionType", "modifier": "private", "original_string": "private CompressionType compressionType;", "type": "CompressionType", "var_name": "compressionType" }, { "declarator": "writer", "modifier": "private", "original_string": "private SequenceFile.Writer writer;", "type": "SequenceFile.Writer", "var_name": "writer" }, { "declarator": "defaultKey", "modifier": "private", "original_string": "private LongWritable defaultKey;", "type": "LongWritable", "var_name": "defaultKey" }, { "declarator": "codecFactory", "modifier": "private", "original_string": "private CodecFactory codecFactory;", "type": "CodecFactory", "var_name": "codecFactory" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/SequenceFileAccessor.java", "identifier": "SequenceFileAccessor", "interfaces": "", "methods": [ { "class_method_signature": "SequenceFileAccessor.SequenceFileAccessor()", "constructor": true, "full_signature": "public SequenceFileAccessor()", "identifier": "SequenceFileAccessor", "modifiers": "public", "parameters": "()", "return": "", "signature": " SequenceFileAccessor()", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.SequenceFileAccessor(ConfigurationFactory configurationFactory)", "constructor": true, "full_signature": " SequenceFileAccessor(ConfigurationFactory configurationFactory)", "identifier": "SequenceFileAccessor", "modifiers": "", "parameters": "(ConfigurationFactory configurationFactory)", "return": "", "signature": " SequenceFileAccessor(ConfigurationFactory configurationFactory)", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.getReader(JobConf jobConf, InputSplit split)", "constructor": false, "full_signature": "@Override protected Object getReader(JobConf jobConf, InputSplit split)", "identifier": "getReader", "modifiers": "@Override protected", "parameters": "(JobConf jobConf, InputSplit split)", "return": "Object", "signature": "Object getReader(JobConf jobConf, InputSplit split)", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.openForWrite()", "constructor": false, "full_signature": "@Override public boolean openForWrite()", "identifier": "openForWrite", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForWrite()", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.getCompressionCodec(RequestContext context)", "constructor": false, "full_signature": "private void getCompressionCodec(RequestContext context)", "identifier": "getCompressionCodec", "modifiers": "private", "parameters": "(RequestContext context)", "return": "void", "signature": "void getCompressionCodec(RequestContext context)", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.parseCompressionType(String compressType)", "constructor": false, "full_signature": "private String parseCompressionType(String compressType)", "identifier": "parseCompressionType", "modifiers": "private", "parameters": "(String compressType)", "return": "String", "signature": "String parseCompressionType(String compressType)", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.writeNextObject(OneRow onerow)", "constructor": false, "full_signature": "@Override public boolean writeNextObject(OneRow onerow)", "identifier": "writeNextObject", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "boolean", "signature": "boolean writeNextObject(OneRow onerow)", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.getCompressionType()", "constructor": false, "full_signature": "public CompressionType getCompressionType()", "identifier": "getCompressionType", "modifiers": "public", "parameters": "()", "return": "CompressionType", "signature": "CompressionType getCompressionType()", "testcase": false }, { "class_method_signature": "SequenceFileAccessor.getCodec()", "constructor": false, "full_signature": "public CompressionCodec getCodec()", "identifier": "getCodec", "modifiers": "public", "parameters": "()", "return": "CompressionCodec", "signature": "CompressionCodec getCodec()", "testcase": false } ], "superclass": "extends HdfsSplittableDataAccessor" }
{ "body": "public CompressionCodec getCodec() {\n return codec;\n }", "class_method_signature": "SequenceFileAccessor.getCodec()", "constructor": false, "full_signature": "public CompressionCodec getCodec()", "identifier": "getCodec", "invocations": [], "modifiers": "public", "parameters": "()", "return": "CompressionCodec", "signature": "CompressionCodec getCodec()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_56
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/filter/TreeTraverserTest.java", "identifier": "TreeTraverserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFailsWhenNoVisitorIsProvided() {\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"You need to provide at least one visitor for this traverser\");\n\n new TreeTraverser().traverse(new Node());\n }", "class_method_signature": "TreeTraverserTest.testFailsWhenNoVisitorIsProvided()", "constructor": false, "full_signature": "@Test public void testFailsWhenNoVisitorIsProvided()", "identifier": "testFailsWhenNoVisitorIsProvided", "invocations": [ "expect", "expectMessage", "traverse" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFailsWhenNoVisitorIsProvided()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(TreeTraverser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(TreeTraverser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/filter/TreeTraverser.java", "identifier": "TreeTraverser", "interfaces": "", "methods": [ { "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor... visitors)", "constructor": false, "full_signature": "public Node traverse(Node node, TreeVisitor... visitors)", "identifier": "traverse", "modifiers": "public", "parameters": "(Node node, TreeVisitor... visitors)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor... visitors)", "testcase": false }, { "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor visitor, final int level)", "constructor": false, "full_signature": "protected Node traverse(Node node, TreeVisitor visitor, final int level)", "identifier": "traverse", "modifiers": "protected", "parameters": "(Node node, TreeVisitor visitor, final int level)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor visitor, final int level)", "testcase": false }, { "class_method_signature": "TreeTraverser.traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "constructor": false, "full_signature": "private void traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "identifier": "traverseHelper", "modifiers": "private", "parameters": "(Node node, int index, TreeVisitor visitor, final int level)", "return": "void", "signature": "void traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "testcase": false } ], "superclass": "" }
{ "body": "public Node traverse(Node node, TreeVisitor... visitors) {\n\n if (ArrayUtils.isEmpty(visitors)) {\n throw new IllegalArgumentException(\"You need to provide at least one visitor for this traverser\");\n }\n\n Node result = node;\n for (TreeVisitor visitor : visitors) {\n result = traverse(result, visitor, 0);\n }\n return result;\n }", "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor... visitors)", "constructor": false, "full_signature": "public Node traverse(Node node, TreeVisitor... visitors)", "identifier": "traverse", "invocations": [ "isEmpty", "traverse" ], "modifiers": "public", "parameters": "(Node node, TreeVisitor... visitors)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor... visitors)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_366
{ "fields": [ { "declarator": "connConfig", "modifier": "private", "original_string": "private Properties connConfig, poolConfig;", "type": "Properties", "var_name": "connConfig" }, { "declarator": "poolDescriptor", "modifier": "private", "original_string": "private PoolDescriptor poolDescriptor;", "type": "PoolDescriptor", "var_name": "poolDescriptor" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/utils/PoolDescriptorTest.java", "identifier": "PoolDescriptorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPoolDescriptor() {\n poolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", connConfig, poolConfig, null);\n assertEquals(\"test-server\", poolDescriptor.getServer());\n assertEquals(\"test-jdbcUrl\", poolDescriptor.getJdbcUrl());\n assertEquals(\"test-password\", poolDescriptor.getPassword());\n\n assertNotEquals(connConfig, poolDescriptor.getConnectionConfig());\n connConfig.remove(\"user\");\n connConfig.remove(\"password\");\n assertEquals(connConfig, poolDescriptor.getConnectionConfig());\n assertNotSame(connConfig, poolDescriptor.getConnectionConfig());\n\n assertEquals(poolConfig, poolDescriptor.getPoolConfig());\n assertNotSame(poolConfig, poolDescriptor.getPoolConfig());\n }", "class_method_signature": "PoolDescriptorTest.testPoolDescriptor()", "constructor": false, "full_signature": "@Test public void testPoolDescriptor()", "identifier": "testPoolDescriptor", "invocations": [ "assertEquals", "getServer", "assertEquals", "getJdbcUrl", "assertEquals", "getPassword", "assertNotEquals", "getConnectionConfig", "remove", "remove", "assertEquals", "getConnectionConfig", "assertNotSame", "getConnectionConfig", "assertEquals", "getPoolConfig", "assertNotSame", "getPoolConfig" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testPoolDescriptor()", "testcase": true }
{ "fields": [ { "declarator": "USER_PROPERTY_NAME = \"user\"", "modifier": "private static final", "original_string": "private static final String USER_PROPERTY_NAME = \"user\";", "type": "String", "var_name": "USER_PROPERTY_NAME" }, { "declarator": "PASSWORD_PROPERTY_NAME = \"password\"", "modifier": "private static final", "original_string": "private static final String PASSWORD_PROPERTY_NAME = \"password\";", "type": "String", "var_name": "PASSWORD_PROPERTY_NAME" }, { "declarator": "PROHIBITED_PROPERTIES =\n Sets.newHashSet(\"username\", \"password\", \"dataSource.user\", \"dataSource.password\", \"dataSourceClassName\", \"jdbcUrl\")", "modifier": "private static final", "original_string": "private static final Set<String> PROHIBITED_PROPERTIES =\n Sets.newHashSet(\"username\", \"password\", \"dataSource.user\", \"dataSource.password\", \"dataSourceClassName\", \"jdbcUrl\");", "type": "Set<String>", "var_name": "PROHIBITED_PROPERTIES" }, { "declarator": "server", "modifier": "private", "original_string": "private String server;", "type": "String", "var_name": "server" }, { "declarator": "jdbcUrl", "modifier": "private", "original_string": "private String jdbcUrl;", "type": "String", "var_name": "jdbcUrl" }, { "declarator": "user", "modifier": "private", "original_string": "private String user;", "type": "String", "var_name": "user" }, { "declarator": "password", "modifier": "private", "original_string": "private String password;", "type": "String", "var_name": "password" }, { "declarator": "connectionConfig", "modifier": "private", "original_string": "private Properties connectionConfig, poolConfig;", "type": "Properties", "var_name": "connectionConfig" }, { "declarator": "qualifier", "modifier": "private", "original_string": "private String qualifier;", "type": "String", "var_name": "qualifier" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/utils/PoolDescriptor.java", "identifier": "PoolDescriptor", "interfaces": "", "methods": [ { "class_method_signature": "PoolDescriptor.PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "constructor": true, "full_signature": "public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "identifier": "PoolDescriptor", "modifiers": "public", "parameters": "(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "return": "", "signature": " PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "testcase": false }, { "class_method_signature": "PoolDescriptor.getServer()", "constructor": false, "full_signature": "public String getServer()", "identifier": "getServer", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getServer()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getJdbcUrl()", "constructor": false, "full_signature": "public String getJdbcUrl()", "identifier": "getJdbcUrl", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getJdbcUrl()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getUser()", "constructor": false, "full_signature": "public String getUser()", "identifier": "getUser", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getUser()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getPassword()", "constructor": false, "full_signature": "public String getPassword()", "identifier": "getPassword", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getPassword()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getConnectionConfig()", "constructor": false, "full_signature": "public Properties getConnectionConfig()", "identifier": "getConnectionConfig", "modifiers": "public", "parameters": "()", "return": "Properties", "signature": "Properties getConnectionConfig()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getPoolConfig()", "constructor": false, "full_signature": "public Properties getPoolConfig()", "identifier": "getPoolConfig", "modifiers": "public", "parameters": "()", "return": "Properties", "signature": "Properties getPoolConfig()", "testcase": false }, { "class_method_signature": "PoolDescriptor.equals(Object o)", "constructor": false, "full_signature": "@Override public boolean equals(Object o)", "identifier": "equals", "modifiers": "@Override public", "parameters": "(Object o)", "return": "boolean", "signature": "boolean equals(Object o)", "testcase": false }, { "class_method_signature": "PoolDescriptor.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "modifiers": "@Override public", "parameters": "()", "return": "int", "signature": "int hashCode()", "testcase": false }, { "class_method_signature": "PoolDescriptor.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toString()", "testcase": false }, { "class_method_signature": "PoolDescriptor.ensurePoolPropertyNotPresent(String propName)", "constructor": false, "full_signature": "private void ensurePoolPropertyNotPresent(String propName)", "identifier": "ensurePoolPropertyNotPresent", "modifiers": "private", "parameters": "(String propName)", "return": "void", "signature": "void ensurePoolPropertyNotPresent(String propName)", "testcase": false } ], "superclass": "" }
{ "body": "public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier) {\n this.server = server;\n this.jdbcUrl = jdbcUrl;\n\n if (connectionConfig != null) {\n this.connectionConfig = (Properties) connectionConfig.clone();\n // extract credentials to treat them explicitly, remove from connection properties\n this.user = (String) this.connectionConfig.remove(USER_PROPERTY_NAME);\n this.password = (String) this.connectionConfig.remove(PASSWORD_PROPERTY_NAME);\n }\n\n this.poolConfig = (Properties) poolConfig.clone();\n this.qualifier = qualifier;\n\n // validate pool configuration\n PROHIBITED_PROPERTIES.forEach(p -> ensurePoolPropertyNotPresent(p));\n }", "class_method_signature": "PoolDescriptor.PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "constructor": true, "full_signature": "public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "identifier": "PoolDescriptor", "invocations": [], "modifiers": "public", "parameters": "(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "return": "", "signature": " PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_389
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/JdbcPartitionFragmenterTest.java", "identifier": "JdbcPartitionFragmenterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPartitionByTypeInvalid() {\n thrown.expect(IllegalArgumentException.class);\n\n context.addOption(\"PARTITION_BY\", \"level:float\");\n new JdbcPartitionFragmenter().initialize(context);\n }", "class_method_signature": "JdbcPartitionFragmenterTest.testPartitionByTypeInvalid()", "constructor": false, "full_signature": "@Test public void testPartitionByTypeInvalid()", "identifier": "testPartitionByTypeInvalid", "invocations": [ "expect", "addOption", "initialize" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testPartitionByTypeInvalid()", "testcase": true }
{ "fields": [ { "declarator": "pxfHosts = {\"localhost\"}", "modifier": "private static final", "original_string": "private static final String[] pxfHosts = {\"localhost\"};", "type": "String[]", "var_name": "pxfHosts" }, { "declarator": "partitionType", "modifier": "private", "original_string": "private PartitionType partitionType;", "type": "PartitionType", "var_name": "partitionType" }, { "declarator": "column", "modifier": "private", "original_string": "private String column;", "type": "String", "var_name": "column" }, { "declarator": "range", "modifier": "private", "original_string": "private String range;", "type": "String", "var_name": "range" }, { "declarator": "interval", "modifier": "private", "original_string": "private String interval;", "type": "String", "var_name": "interval" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/JdbcPartitionFragmenter.java", "identifier": "JdbcPartitionFragmenter", "interfaces": "", "methods": [ { "class_method_signature": "JdbcPartitionFragmenter.initialize(RequestContext context)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext context)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "void", "signature": "void initialize(RequestContext context)", "testcase": false }, { "class_method_signature": "JdbcPartitionFragmenter.getFragments()", "constructor": false, "full_signature": "@Override public List<Fragment> getFragments()", "identifier": "getFragments", "modifiers": "@Override public", "parameters": "()", "return": "List<Fragment>", "signature": "List<Fragment> getFragments()", "testcase": false }, { "class_method_signature": "JdbcPartitionFragmenter.createFragment(byte[] fragmentMetadata)", "constructor": false, "full_signature": "private Fragment createFragment(byte[] fragmentMetadata)", "identifier": "createFragment", "modifiers": "private", "parameters": "(byte[] fragmentMetadata)", "return": "Fragment", "signature": "Fragment createFragment(byte[] fragmentMetadata)", "testcase": false }, { "class_method_signature": "JdbcPartitionFragmenter.getFragmentStats()", "constructor": false, "full_signature": "@Override public FragmentStats getFragmentStats()", "identifier": "getFragmentStats", "modifiers": "@Override public", "parameters": "()", "return": "FragmentStats", "signature": "FragmentStats getFragmentStats()", "testcase": false } ], "superclass": "extends BaseFragmenter" }
{ "body": "@Override\n public void initialize(RequestContext context) {\n super.initialize(context);\n\n String partitionByOption = context.getOption(\"PARTITION_BY\");\n if (partitionByOption == null) return;\n\n try {\n String[] partitionBy = partitionByOption.split(\":\");\n column = partitionBy[0];\n partitionType = PartitionType.of(partitionBy[1]);\n } catch (ArrayIndexOutOfBoundsException e) {\n throw new IllegalArgumentException(\"The parameter 'PARTITION_BY' has incorrect format. The correct format is '<column_name>:{int|date|enum}'\");\n }\n\n range = context.getOption(\"RANGE\");\n interval = context.getOption(\"INTERVAL\");\n }", "class_method_signature": "JdbcPartitionFragmenter.initialize(RequestContext context)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext context)", "identifier": "initialize", "invocations": [ "initialize", "getOption", "split", "of", "getOption", "getOption" ], "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "void", "signature": "void initialize(RequestContext context)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_223
{ "fields": [ { "declarator": "parameters", "modifier": "private", "original_string": "private MultivaluedMap<String, String> parameters;", "type": "MultivaluedMap<String, String>", "var_name": "parameters" }, { "declarator": "parser", "modifier": "private", "original_string": "private HttpRequestParser parser;", "type": "HttpRequestParser", "var_name": "parser" }, { "declarator": "mockRequestHeaders", "modifier": "@Mock\n private", "original_string": "@Mock\n private ContainerRequest mockRequestHeaders;", "type": "ContainerRequest", "var_name": "mockRequestHeaders" }, { "declarator": "mockPluginConf", "modifier": "@Mock\n private", "original_string": "@Mock\n private PluginConf mockPluginConf;", "type": "PluginConf", "var_name": "mockPluginConf" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/HttpRequestParserTest.java", "identifier": "HttpRequestParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInvalidHandlerCausesException() {\n thrown.expect(RuntimeException.class);\n thrown.expectMessage(\"Error when invoking handlerClass 'foo' : java.lang.ClassNotFoundException: foo\");\n when(mockPluginConf.getHandler(\"test-profile\")).thenReturn(\"foo\");\n parameters.putSingle(\"X-GP-OPTIONS-PROFILE\", \"test-profile\");\n parser.parseRequest(mockRequestHeaders, RequestType.FRAGMENTER);\n }", "class_method_signature": "HttpRequestParserTest.testInvalidHandlerCausesException()", "constructor": false, "full_signature": "@Test public void testInvalidHandlerCausesException()", "identifier": "testInvalidHandlerCausesException", "invocations": [ "expect", "expectMessage", "thenReturn", "when", "getHandler", "putSingle", "parseRequest" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testInvalidHandlerCausesException()", "testcase": true }
{ "fields": [ { "declarator": "TRUE_LCASE = \"true\"", "modifier": "private static final", "original_string": "private static final String TRUE_LCASE = \"true\";", "type": "String", "var_name": "TRUE_LCASE" }, { "declarator": "FALSE_LCASE = \"false\"", "modifier": "private static final", "original_string": "private static final String FALSE_LCASE = \"false\";", "type": "String", "var_name": "FALSE_LCASE" }, { "declarator": "LOG = LoggerFactory.getLogger(HttpRequestParser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpRequestParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "instance = new HttpRequestParser()", "modifier": "private static final", "original_string": "private static final HttpRequestParser instance = new HttpRequestParser();", "type": "HttpRequestParser", "var_name": "instance" }, { "declarator": "PROFILE_SCHEME = \"PROFILE-SCHEME\"", "modifier": "private static final", "original_string": "private static final String PROFILE_SCHEME = \"PROFILE-SCHEME\";", "type": "String", "var_name": "PROFILE_SCHEME" }, { "declarator": "pluginConf", "modifier": "private", "original_string": "private PluginConf pluginConf;", "type": "PluginConf", "var_name": "pluginConf" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/HttpRequestParser.java", "identifier": "HttpRequestParser", "interfaces": "implements RequestParser<HttpHeaders>", "methods": [ { "class_method_signature": "HttpRequestParser.HttpRequestParser()", "constructor": true, "full_signature": "public HttpRequestParser()", "identifier": "HttpRequestParser", "modifiers": "public", "parameters": "()", "return": "", "signature": " HttpRequestParser()", "testcase": false }, { "class_method_signature": "HttpRequestParser.HttpRequestParser(PluginConf pluginConf)", "constructor": true, "full_signature": " HttpRequestParser(PluginConf pluginConf)", "identifier": "HttpRequestParser", "modifiers": "", "parameters": "(PluginConf pluginConf)", "return": "", "signature": " HttpRequestParser(PluginConf pluginConf)", "testcase": false }, { "class_method_signature": "HttpRequestParser.getInstance()", "constructor": false, "full_signature": "public static HttpRequestParser getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "HttpRequestParser", "signature": "HttpRequestParser getInstance()", "testcase": false }, { "class_method_signature": "HttpRequestParser.protocolViolation(String property)", "constructor": false, "full_signature": "private static void protocolViolation(String property)", "identifier": "protocolViolation", "modifiers": "private static", "parameters": "(String property)", "return": "void", "signature": "void protocolViolation(String property)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseGreenplumCSV(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseGreenplumCSV(RequestMap params, RequestContext context)", "identifier": "parseGreenplumCSV", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseGreenplumCSV(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.addProfilePlugins(String profile, RequestMap params)", "constructor": false, "full_signature": "private void addProfilePlugins(String profile, RequestMap params)", "identifier": "addProfilePlugins", "modifiers": "private", "parameters": "(String profile, RequestMap params)", "return": "void", "signature": "void addProfilePlugins(String profile, RequestMap params)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseBooleanValue(String threadSafeStr)", "constructor": false, "full_signature": "private boolean parseBooleanValue(String threadSafeStr)", "identifier": "parseBooleanValue", "modifiers": "private", "parameters": "(String threadSafeStr)", "return": "boolean", "signature": "boolean parseBooleanValue(String threadSafeStr)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTupleDescription(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseTupleDescription(RequestMap params, RequestContext context)", "identifier": "parseTupleDescription", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseTupleDescription(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTypeMods(RequestMap params, int columnIndex)", "constructor": false, "full_signature": "private Integer[] parseTypeMods(RequestMap params, int columnIndex)", "identifier": "parseTypeMods", "modifiers": "private", "parameters": "(RequestMap params, int columnIndex)", "return": "Integer[]", "signature": "Integer[] parseTypeMods(RequestMap params, int columnIndex)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parsePositiveIntOrError(String s, String propName)", "constructor": false, "full_signature": "private int parsePositiveIntOrError(String s, String propName)", "identifier": "parsePositiveIntOrError", "modifiers": "private", "parameters": "(String s, String propName)", "return": "int", "signature": "int parsePositiveIntOrError(String s, String propName)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType) {\n\n RequestMap params = new RequestMap(request.getRequestHeaders());\n\n if (LOG.isDebugEnabled()) {\n // Logging only keys to prevent sensitive data to be logged\n LOG.debug(\"Parsing request parameters: \" + params.keySet());\n }\n\n // build new instance of RequestContext and fill it with parsed values\n RequestContext context = new RequestContext();\n\n // whether we are in a fragmenter, read_bridge, or write_bridge scenario\n context.setRequestType(requestType);\n\n // first of all, set profile and enrich parameters with information from specified profile\n String profile = params.removeUserProperty(\"PROFILE\");\n context.setProfile(profile);\n addProfilePlugins(profile, params);\n\n // Ext table uses system property FORMAT for wire serialization format\n String wireFormat = params.removeProperty(\"FORMAT\");\n context.setOutputFormat(OutputFormat.valueOf(wireFormat));\n\n // FDW uses user property FORMAT to indicate format of data\n String format = params.removeUserProperty(\"FORMAT\");\n format = StringUtils.isNotBlank(format) ? format : context.inferFormatName();\n context.setFormat(format);\n\n context.setAccessor(params.removeUserProperty(\"ACCESSOR\"));\n context.setAggType(EnumAggregationType.getAggregationType(params.removeOptionalProperty(\"AGG-TYPE\")));\n\n /*\n * Some resources don't require a fragment, hence the list can be empty.\n */\n String fragmentStr = params.removeOptionalProperty(\"DATA-FRAGMENT\");\n if (StringUtils.isNotBlank(fragmentStr)) {\n context.setDataFragment(Integer.parseInt(fragmentStr));\n }\n\n context.setDataSource(params.removeProperty(\"DATA-DIR\"));\n\n String filterString = params.removeOptionalProperty(\"FILTER\");\n String hasFilter = params.removeProperty(\"HAS-FILTER\");\n if (filterString != null) {\n context.setFilterString(filterString);\n } else if (\"1\".equals(hasFilter)) {\n LOG.info(\"Original query has filter, but it was not propagated to PXF\");\n }\n\n context.setFragmenter(params.removeUserProperty(\"FRAGMENTER\"));\n\n String fragmentIndexStr = params.removeOptionalProperty(\"FRAGMENT-INDEX\");\n if (StringUtils.isNotBlank(fragmentIndexStr)) {\n context.setFragmentIndex(Integer.parseInt(fragmentIndexStr));\n }\n\n String encodedFragmentMetadata = params.removeOptionalProperty(\"FRAGMENT-METADATA\");\n context.setFragmentMetadata(Utilities.parseBase64(encodedFragmentMetadata, \"Fragment metadata information\"));\n context.setHost(params.removeProperty(\"URL-HOST\"));\n context.setMetadata(params.removeUserProperty(\"METADATA\"));\n context.setPort(params.removeIntProperty(\"URL-PORT\"));\n context.setProfileScheme(params.removeUserProperty(PROFILE_SCHEME));\n context.setProtocol(params.removeUserProperty(\"PROTOCOL\"));\n context.setRemoteLogin(params.removeOptionalProperty(\"REMOTE-USER\"));\n context.setRemoteSecret(params.removeOptionalProperty(\"REMOTE-PASS\"));\n context.setResolver(params.removeUserProperty(\"RESOLVER\"));\n context.setSegmentId(params.removeIntProperty(\"SEGMENT-ID\"));\n context.setServerName(params.removeUserProperty(\"SERVER\"));\n\n // An optional CONFIG value specifies the name of the server\n // configuration directory, if not provided the config is the server name\n String config = params.removeUserProperty(\"CONFIG\");\n context.setConfig(StringUtils.isNotBlank(config) ? config : context.getServerName());\n\n String maxFrags = params.removeUserProperty(\"STATS-MAX-FRAGMENTS\");\n if (!StringUtils.isBlank(maxFrags)) {\n context.setStatsMaxFragments(Integer.parseInt(maxFrags));\n }\n\n String sampleRatioStr = params.removeUserProperty(\"STATS-SAMPLE-RATIO\");\n if (!StringUtils.isBlank(sampleRatioStr)) {\n context.setStatsSampleRatio(Float.parseFloat(sampleRatioStr));\n }\n\n context.setTotalSegments(params.removeIntProperty(\"SEGMENT-COUNT\"));\n context.setTransactionId(params.removeProperty(\"XID\"));\n\n // parse tuple description\n parseTupleDescription(params, context);\n\n if (context.getOutputFormat() == OutputFormat.TEXT) {\n // parse CSV format information\n parseGreenplumCSV(params, context);\n\n // Only single column tables support 'OFF' delimiter\n if (context.getTupleDescription().size() != 1 && context.getGreenplumCSV().getDelimiter() == null) {\n throw new IllegalArgumentException(String.format(\"using no delimiter is only possible for a single column table. %d columns found\", context.getTupleDescription().size()));\n }\n }\n\n context.setUser(params.removeProperty(\"USER\"));\n\n String encodedFragmentUserData = params.removeOptionalProperty(\"FRAGMENT-USER-DATA\");\n context.setUserData(Utilities.parseBase64(encodedFragmentUserData, \"Fragment user data\"));\n\n // Store alignment for global use as a system property\n System.setProperty(\"greenplum.alignment\", params.removeProperty(\"ALIGNMENT\"));\n\n Map<String, String> optionMappings = null;\n\n // prepare addition configuration properties if profile was specified\n if (StringUtils.isNotBlank(profile)) {\n optionMappings = pluginConf.getOptionMappings(profile);\n }\n\n // use empty map for convenience instead of null\n if (optionMappings == null) {\n optionMappings = Collections.emptyMap();\n }\n\n Map<String, String> additionalConfigProps = new HashMap<>();\n\n // Iterate over the remaining properties\n // we clone the keyset to prevent concurrent modification exceptions\n List<String> paramNames = new ArrayList<>(params.keySet());\n for (String param : paramNames) {\n if (StringUtils.startsWithIgnoreCase(param, RequestMap.USER_PROP_PREFIX)) {\n // Add all left-over user properties as options\n String optionName = param.toLowerCase().replace(RequestMap.USER_PROP_PREFIX_LOWERCASE, \"\");\n String optionValue = params.removeUserProperty(optionName);\n context.addOption(optionName, optionValue);\n LOG.debug(\"Added option {} to request context\", optionName);\n\n // lookup if the option should also be applied as a config property\n String propertyName = optionMappings.get(optionName);\n if (StringUtils.isNotBlank(propertyName)) {\n // if option has been provided by the user in the request, set the value\n // of the corresponding configuration property\n if (optionValue != null) {\n additionalConfigProps.put(propertyName, optionValue);\n // do not log property value as it might contain sensitive information\n LOG.debug(\"Added extra config property {} from option {}\", propertyName, optionName);\n }\n }\n } else if (StringUtils.startsWithIgnoreCase(param, RequestMap.PROP_PREFIX)) {\n // log debug for all left-over system properties\n LOG.debug(\"Unused property {}\", param);\n }\n }\n\n context.setAdditionalConfigProps(additionalConfigProps);\n context.setPluginConf(pluginConf);\n\n // Call the protocol handler for any protocol-specific logic handling\n if (StringUtils.isNotBlank(profile)) {\n String handlerClassName = pluginConf.getHandler(profile);\n if (StringUtils.isNotBlank(handlerClassName)) {\n Class<?> clazz;\n try {\n clazz = Class.forName(handlerClassName);\n ProtocolHandler handler = (ProtocolHandler) clazz.getDeclaredConstructor().newInstance();\n context.setFragmenter(handler.getFragmenterClassName(context));\n context.setAccessor(handler.getAccessorClassName(context));\n context.setResolver(handler.getResolverClassName(context));\n } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |\n InstantiationException | IllegalAccessException e) {\n throw new RuntimeException(String.format(\"Error when invoking handlerClass '%s' : %s\", handlerClassName, e), e);\n }\n }\n }\n\n // validate that the result has all required fields, and values are in valid ranges\n context.validate();\n\n return context;\n }", "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "invocations": [ "getRequestHeaders", "isDebugEnabled", "debug", "keySet", "setRequestType", "removeUserProperty", "setProfile", "addProfilePlugins", "removeProperty", "setOutputFormat", "valueOf", "removeUserProperty", "isNotBlank", "inferFormatName", "setFormat", "setAccessor", "removeUserProperty", "setAggType", "getAggregationType", "removeOptionalProperty", "removeOptionalProperty", "isNotBlank", "setDataFragment", "parseInt", "setDataSource", "removeProperty", "removeOptionalProperty", "removeProperty", "setFilterString", "equals", "info", "setFragmenter", "removeUserProperty", "removeOptionalProperty", "isNotBlank", "setFragmentIndex", "parseInt", "removeOptionalProperty", "setFragmentMetadata", "parseBase64", "setHost", "removeProperty", "setMetadata", "removeUserProperty", "setPort", "removeIntProperty", "setProfileScheme", "removeUserProperty", "setProtocol", "removeUserProperty", "setRemoteLogin", "removeOptionalProperty", "setRemoteSecret", "removeOptionalProperty", "setResolver", "removeUserProperty", "setSegmentId", "removeIntProperty", "setServerName", "removeUserProperty", "removeUserProperty", "setConfig", "isNotBlank", "getServerName", "removeUserProperty", "isBlank", "setStatsMaxFragments", "parseInt", "removeUserProperty", "isBlank", "setStatsSampleRatio", "parseFloat", "setTotalSegments", "removeIntProperty", "setTransactionId", "removeProperty", "parseTupleDescription", "getOutputFormat", "parseGreenplumCSV", "size", "getTupleDescription", "getDelimiter", "getGreenplumCSV", "format", "size", "getTupleDescription", "setUser", "removeProperty", "removeOptionalProperty", "setUserData", "parseBase64", "setProperty", "removeProperty", "isNotBlank", "getOptionMappings", "emptyMap", "keySet", "startsWithIgnoreCase", "replace", "toLowerCase", "removeUserProperty", "addOption", "debug", "get", "isNotBlank", "put", "debug", "startsWithIgnoreCase", "debug", "setAdditionalConfigProps", "setPluginConf", "isNotBlank", "getHandler", "isNotBlank", "forName", "newInstance", "getDeclaredConstructor", "setFragmenter", "getFragmenterClassName", "setAccessor", "getAccessorClassName", "setResolver", "getResolverClassName", "format", "validate" ], "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_40
{ "fields": [], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/filter/NodeTest.java", "identifier": "NodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testChildCount() {\n Node root = new Node();\n\n assertEquals(0, root.childCount());\n\n Node left = new Node();\n root.setLeft(left);\n\n assertEquals(1, root.childCount());\n\n Node right = new Node();\n root.setRight(right);\n\n assertEquals(2, root.childCount());\n }", "class_method_signature": "NodeTest.testChildCount()", "constructor": false, "full_signature": "@Test public void testChildCount()", "identifier": "testChildCount", "invocations": [ "assertEquals", "childCount", "setLeft", "assertEquals", "childCount", "setRight", "assertEquals", "childCount" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testChildCount()", "testcase": true }
{ "fields": [ { "declarator": "left", "modifier": "private", "original_string": "private Node left;", "type": "Node", "var_name": "left" }, { "declarator": "right", "modifier": "private", "original_string": "private Node right;", "type": "Node", "var_name": "right" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/filter/Node.java", "identifier": "Node", "interfaces": "", "methods": [ { "class_method_signature": "Node.Node()", "constructor": true, "full_signature": "public Node()", "identifier": "Node", "modifiers": "public", "parameters": "()", "return": "", "signature": " Node()", "testcase": false }, { "class_method_signature": "Node.Node(Node left)", "constructor": true, "full_signature": "public Node(Node left)", "identifier": "Node", "modifiers": "public", "parameters": "(Node left)", "return": "", "signature": " Node(Node left)", "testcase": false }, { "class_method_signature": "Node.Node(Node left, Node right)", "constructor": true, "full_signature": "public Node(Node left, Node right)", "identifier": "Node", "modifiers": "public", "parameters": "(Node left, Node right)", "return": "", "signature": " Node(Node left, Node right)", "testcase": false }, { "class_method_signature": "Node.setLeft(Node left)", "constructor": false, "full_signature": "public void setLeft(Node left)", "identifier": "setLeft", "modifiers": "public", "parameters": "(Node left)", "return": "void", "signature": "void setLeft(Node left)", "testcase": false }, { "class_method_signature": "Node.getLeft()", "constructor": false, "full_signature": "public Node getLeft()", "identifier": "getLeft", "modifiers": "public", "parameters": "()", "return": "Node", "signature": "Node getLeft()", "testcase": false }, { "class_method_signature": "Node.setRight(Node right)", "constructor": false, "full_signature": "public void setRight(Node right)", "identifier": "setRight", "modifiers": "public", "parameters": "(Node right)", "return": "void", "signature": "void setRight(Node right)", "testcase": false }, { "class_method_signature": "Node.getRight()", "constructor": false, "full_signature": "public Node getRight()", "identifier": "getRight", "modifiers": "public", "parameters": "()", "return": "Node", "signature": "Node getRight()", "testcase": false }, { "class_method_signature": "Node.childCount()", "constructor": false, "full_signature": "public int childCount()", "identifier": "childCount", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int childCount()", "testcase": false } ], "superclass": "" }
{ "body": "public int childCount() {\n int count = 0;\n if (left != null) count++;\n if (right != null) count++;\n return count;\n }", "class_method_signature": "Node.childCount()", "constructor": false, "full_signature": "public int childCount()", "identifier": "childCount", "invocations": [], "modifiers": "public", "parameters": "()", "return": "int", "signature": "int childCount()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_409
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3SelectAccessorTest.java", "identifier": "S3SelectAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFailsToParseNullDataSource() {\n thrown.expect(NullPointerException.class);\n\n RequestContext context = new RequestContext();\n new S3SelectAccessor().generateBaseCSVRequest(context);\n }", "class_method_signature": "S3SelectAccessorTest.testFailsToParseNullDataSource()", "constructor": false, "full_signature": "@Test public void testFailsToParseNullDataSource()", "identifier": "testFailsToParseNullDataSource", "invocations": [ "expect", "generateBaseCSVRequest" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFailsToParseNullDataSource()", "testcase": true }
{ "fields": [ { "declarator": "COMPRESSION_TYPE = \"COMPRESSION_CODEC\"", "modifier": "public static final", "original_string": "public static final String COMPRESSION_TYPE = \"COMPRESSION_CODEC\";", "type": "String", "var_name": "COMPRESSION_TYPE" }, { "declarator": "FILE_HEADER_INFO = \"FILE_HEADER\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO = \"FILE_HEADER\";", "type": "String", "var_name": "FILE_HEADER_INFO" }, { "declarator": "FILE_HEADER_INFO_NONE = \"NONE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_NONE = \"NONE\";", "type": "String", "var_name": "FILE_HEADER_INFO_NONE" }, { "declarator": "FILE_HEADER_INFO_IGNORE = \"IGNORE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_IGNORE = \"IGNORE\";", "type": "String", "var_name": "FILE_HEADER_INFO_IGNORE" }, { "declarator": "FILE_HEADER_INFO_USE = \"USE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_USE = \"USE\";", "type": "String", "var_name": "FILE_HEADER_INFO_USE" }, { "declarator": "JSON_TYPE = \"JSON-TYPE\"", "modifier": "public static final", "original_string": "public static final String JSON_TYPE = \"JSON-TYPE\";", "type": "String", "var_name": "JSON_TYPE" }, { "declarator": "isResultComplete", "modifier": "private", "original_string": "private AtomicBoolean isResultComplete;", "type": "AtomicBoolean", "var_name": "isResultComplete" }, { "declarator": "s3Client", "modifier": "private", "original_string": "private AmazonS3 s3Client;", "type": "AmazonS3", "var_name": "s3Client" }, { "declarator": "result", "modifier": "private", "original_string": "private SelectObjectContentResult result;", "type": "SelectObjectContentResult", "var_name": "result" }, { "declarator": "resultInputStream", "modifier": "private", "original_string": "private InputStream resultInputStream;", "type": "InputStream", "var_name": "resultInputStream" }, { "declarator": "reader", "modifier": "private", "original_string": "private BufferedReader reader;", "type": "BufferedReader", "var_name": "reader" }, { "declarator": "lineReadCount", "modifier": "private", "original_string": "private int lineReadCount;", "type": "int", "var_name": "lineReadCount" }, { "declarator": "name", "modifier": "private", "original_string": "private URI name;", "type": "URI", "var_name": "name" } ], "file": "server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3SelectAccessor.java", "identifier": "S3SelectAccessor", "interfaces": "implements Accessor", "methods": [ { "class_method_signature": "S3SelectAccessor.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForRead()", "constructor": false, "full_signature": "@Override public boolean openForRead()", "identifier": "openForRead", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.readNextObject()", "constructor": false, "full_signature": "@Override public OneRow readNextObject()", "identifier": "readNextObject", "modifiers": "@Override public", "parameters": "()", "return": "OneRow", "signature": "OneRow readNextObject()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForRead()", "constructor": false, "full_signature": "@Override public void closeForRead()", "identifier": "closeForRead", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.generateBaseCSVRequest(RequestContext context)", "constructor": false, "full_signature": " SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "identifier": "generateBaseCSVRequest", "modifiers": "", "parameters": "(RequestContext context)", "return": "SelectObjectContentRequest", "signature": "SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getOutputSerialization(RequestContext context)", "constructor": false, "full_signature": "private OutputSerialization getOutputSerialization(RequestContext context)", "identifier": "getOutputSerialization", "modifiers": "private", "parameters": "(RequestContext context)", "return": "OutputSerialization", "signature": "OutputSerialization getOutputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getInputSerialization(RequestContext context)", "constructor": false, "full_signature": " InputSerialization getInputSerialization(RequestContext context)", "identifier": "getInputSerialization", "modifiers": "", "parameters": "(RequestContext context)", "return": "InputSerialization", "signature": "InputSerialization getInputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getJSONInput(RequestContext context)", "constructor": false, "full_signature": " JSONInput getJSONInput(RequestContext context)", "identifier": "getJSONInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "JSONInput", "signature": "JSONInput getJSONInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getCSVInput(RequestContext context)", "constructor": false, "full_signature": " CSVInput getCSVInput(RequestContext context)", "identifier": "getCSVInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "CSVInput", "signature": "CSVInput getCSVInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.initS3Client()", "constructor": false, "full_signature": "private AmazonS3 initS3Client()", "identifier": "initS3Client", "modifiers": "private", "parameters": "()", "return": "AmazonS3", "signature": "AmazonS3 initS3Client()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForWrite()", "constructor": false, "full_signature": "@Override public boolean openForWrite()", "identifier": "openForWrite", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForWrite()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.writeNextObject(OneRow onerow)", "constructor": false, "full_signature": "@Override public boolean writeNextObject(OneRow onerow)", "identifier": "writeNextObject", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "boolean", "signature": "boolean writeNextObject(OneRow onerow)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "SelectObjectContentRequest generateBaseCSVRequest(RequestContext context) {\n\n InputSerialization inputSerialization = getInputSerialization(context);\n\n String fileHeaderInfo = context.getOption(FILE_HEADER_INFO);\n boolean usePositionToIdentifyColumn = inputSerialization.getCsv() != null &&\n (StringUtils.isBlank(fileHeaderInfo) ||\n !StringUtils.equalsIgnoreCase(FILE_HEADER_INFO_USE, fileHeaderInfo));\n String query = null;\n try {\n S3SelectQueryBuilder queryBuilder = new S3SelectQueryBuilder(context, usePositionToIdentifyColumn);\n query = queryBuilder.buildSelectQuery();\n } catch (SQLException e) {\n LOG.error(\"Unable to build select query for filter string {}\", context.getFilterString());\n }\n\n LOG.trace(\"Select query: {}\", query);\n\n SelectObjectContentRequest request = new SelectObjectContentRequest();\n request.setBucketName(name.getHost());\n request.setKey(StringUtils.removeStart(name.getPath(), \"/\"));\n request.setExpression(query);\n request.setExpressionType(ExpressionType.SQL);\n\n LOG.debug(\"With bucket name '{}'\", request.getBucketName());\n LOG.debug(\"With key '{}'\", request.getKey());\n LOG.debug(\"With expression query '{}'\", query);\n\n request.setInputSerialization(inputSerialization);\n\n OutputSerialization outputSerialization = getOutputSerialization(context);\n request.setOutputSerialization(outputSerialization);\n\n return request;\n }", "class_method_signature": "S3SelectAccessor.generateBaseCSVRequest(RequestContext context)", "constructor": false, "full_signature": " SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "identifier": "generateBaseCSVRequest", "invocations": [ "getInputSerialization", "getOption", "getCsv", "isBlank", "equalsIgnoreCase", "buildSelectQuery", "error", "getFilterString", "trace", "setBucketName", "getHost", "setKey", "removeStart", "getPath", "setExpression", "setExpressionType", "debug", "getBucketName", "debug", "getKey", "debug", "setInputSerialization", "getOutputSerialization", "setOutputSerialization" ], "modifiers": "", "parameters": "(RequestContext context)", "return": "SelectObjectContentRequest", "signature": "SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_370
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "dbProduct = null", "modifier": "private", "original_string": "private DbProduct dbProduct = null;", "type": "DbProduct", "var_name": "dbProduct" }, { "declarator": "COL_RAW = \"col\"", "modifier": "private final", "original_string": "private final String COL_RAW = \"col\";", "type": "String", "var_name": "COL_RAW" }, { "declarator": "QUOTE = \"\\\"\"", "modifier": "private final", "original_string": "private final String QUOTE = \"\\\"\";", "type": "String", "var_name": "QUOTE" }, { "declarator": "COL = QUOTE + COL_RAW + QUOTE", "modifier": "private final", "original_string": "private final String COL = QUOTE + COL_RAW + QUOTE;", "type": "String", "var_name": "COL" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/partitioning/IntPartitionTest.java", "identifier": "IntPartitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRightBounded() {\n IntPartition partition = new IntPartition(COL_RAW, null, 0L);\n String constraint = partition.toSqlConstraint(QUOTE, dbProduct);\n\n assertEquals(COL + \" < 0\", constraint);\n }", "class_method_signature": "IntPartitionTest.testRightBounded()", "constructor": false, "full_signature": "@Test public void testRightBounded()", "identifier": "testRightBounded", "invocations": [ "toSqlConstraint", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testRightBounded()", "testcase": true }
{ "fields": [ { "declarator": "serialVersionUID = 0L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 0L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "boundaries", "modifier": "private final", "original_string": "private final Long[] boundaries;", "type": "Long[]", "var_name": "boundaries" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/partitioning/IntPartition.java", "identifier": "IntPartition", "interfaces": "implements JdbcFragmentMetadata", "methods": [ { "class_method_signature": "IntPartition.IntPartition(String column, Long start, Long end)", "constructor": true, "full_signature": "public IntPartition(String column, Long start, Long end)", "identifier": "IntPartition", "modifiers": "public", "parameters": "(String column, Long start, Long end)", "return": "", "signature": " IntPartition(String column, Long start, Long end)", "testcase": false }, { "class_method_signature": "IntPartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }, { "class_method_signature": "IntPartition.getBoundaries()", "constructor": false, "full_signature": "public Long[] getBoundaries()", "identifier": "getBoundaries", "modifiers": "public", "parameters": "()", "return": "Long[]", "signature": "Long[] getBoundaries()", "testcase": false } ], "superclass": "extends BasePartition" }
{ "body": "@Override\n public String toSqlConstraint(String quoteString, DbProduct dbProduct) {\n if (quoteString == null) {\n throw new RuntimeException(\"Quote string cannot be null\");\n }\n\n return generateRangeConstraint(\n quoteString + column + quoteString,\n Stream.of(boundaries).map(b -> b == null ? null : b.toString()).toArray(String[]::new)\n );\n }", "class_method_signature": "IntPartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "invocations": [ "generateRangeConstraint", "toArray", "map", "of", "toString" ], "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_235
{ "fields": [ { "declarator": "PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS)", "modifier": "private static final", "original_string": "private static final TreeVisitor PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS);", "type": "TreeVisitor", "var_name": "PRUNER" }, { "declarator": "TRAVERSER = new TreeTraverser()", "modifier": "private static final", "original_string": "private static final TreeTraverser TRAVERSER = new TreeTraverser();", "type": "TreeTraverser", "var_name": "TRAVERSER" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "tupleDescription", "modifier": "private", "original_string": "private HBaseTupleDescription tupleDescription;", "type": "HBaseTupleDescription", "var_name": "tupleDescription" }, { "declarator": "families = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n }", "modifier": "private", "original_string": "private byte[][] families = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n };", "type": "byte[][]", "var_name": "families" }, { "declarator": "qualifiers = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n }", "modifier": "private", "original_string": "private byte[][] qualifiers = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n };", "type": "byte[][]", "var_name": "qualifiers" }, { "declarator": "columnCodes = {\n DataType.INTEGER.getOID(),\n DataType.TEXT.getOID(),\n DataType.REAL.getOID(),\n DataType.TEXT.getOID(),\n }", "modifier": "private", "original_string": "private int[] columnCodes = {\n DataType.INTEGER.getOID(),\n DataType.TEXT.getOID(),\n DataType.REAL.getOID(),\n DataType.TEXT.getOID(),\n };", "type": "int[]", "var_name": "columnCodes" } ], "file": "server/pxf-hbase/src/test/java/org/greenplum/pxf/plugins/hbase/HBaseFilterBuilderTest.java", "identifier": "HBaseFilterBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOrOperator() throws Exception {\n // a1 > '2008-02-01' or a2 > 1200\n Filter filter = helper(\"a1c25s10d2008-02-01o2a2c20s4d1200o2l1\", tupleDescription);\n assertNotNull(filter);\n assertTrue(filter instanceof FilterList);\n FilterList filterList = (FilterList) filter;\n assertEquals(FilterList.Operator.MUST_PASS_ONE, filterList.getOperator());\n\n assertNotNull(filterList.getFilters());\n assertEquals(2, filterList.getFilters().size());\n\n Filter left = filterList.getFilters().get(0);\n Filter right = filterList.getFilters().get(1);\n assertTrue(left instanceof SingleColumnValueFilter);\n assertTrue(right instanceof SingleColumnValueFilter);\n\n SingleColumnValueFilter scvFilterLeft = (SingleColumnValueFilter) left;\n SingleColumnValueFilter scvFilterRight = (SingleColumnValueFilter) right;\n\n assertEquals(families[1], scvFilterLeft.getFamily());\n assertEquals(qualifiers[1], scvFilterLeft.getQualifier());\n assertEquals(CompareFilter.CompareOp.GREATER, scvFilterLeft.getOperator());\n assertEquals(0, scvFilterLeft.getComparator().compareTo(\"2008-02-01\".getBytes()));\n\n assertEquals(families[2], scvFilterRight.getFamily());\n assertEquals(qualifiers[2], scvFilterRight.getQualifier());\n assertEquals(CompareFilter.CompareOp.GREATER, scvFilterRight.getOperator());\n assertEquals(0, scvFilterRight.getComparator().compareTo(\"1200\".getBytes()));\n }", "class_method_signature": "HBaseFilterBuilderTest.testOrOperator()", "constructor": false, "full_signature": "@Test public void testOrOperator()", "identifier": "testOrOperator", "invocations": [ "helper", "assertNotNull", "assertTrue", "assertEquals", "getOperator", "assertNotNull", "getFilters", "assertEquals", "size", "getFilters", "get", "getFilters", "get", "getFilters", "assertTrue", "assertTrue", "assertEquals", "getFamily", "assertEquals", "getQualifier", "assertEquals", "getOperator", "assertEquals", "compareTo", "getComparator", "getBytes", "assertEquals", "getFamily", "assertEquals", "getQualifier", "assertEquals", "getOperator", "assertEquals", "compareTo", "getComparator", "getBytes" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testOrOperator()", "testcase": true }
{ "fields": [ { "declarator": "OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, CompareFilter.CompareOp>() {{\n put(Operator.LESS_THAN, CompareFilter.CompareOp.LESS); // \"<\"\n put(Operator.GREATER_THAN, CompareFilter.CompareOp.GREATER); // \">\"\n put(Operator.LESS_THAN_OR_EQUAL, CompareFilter.CompareOp.LESS_OR_EQUAL); // \"<=\"\n put(Operator.GREATER_THAN_OR_EQUAL, CompareFilter.CompareOp.GREATER_OR_EQUAL); // \">=\"\n put(Operator.EQUALS, CompareFilter.CompareOp.EQUAL); // \"=\"\n put(Operator.NOT_EQUALS, CompareFilter.CompareOp.NOT_EQUAL); // \"!=\"\n }})", "modifier": "private static final", "original_string": "private static final Map<Operator, CompareFilter.CompareOp> OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, CompareFilter.CompareOp>() {{\n put(Operator.LESS_THAN, CompareFilter.CompareOp.LESS); // \"<\"\n put(Operator.GREATER_THAN, CompareFilter.CompareOp.GREATER); // \">\"\n put(Operator.LESS_THAN_OR_EQUAL, CompareFilter.CompareOp.LESS_OR_EQUAL); // \"<=\"\n put(Operator.GREATER_THAN_OR_EQUAL, CompareFilter.CompareOp.GREATER_OR_EQUAL); // \">=\"\n put(Operator.EQUALS, CompareFilter.CompareOp.EQUAL); // \"=\"\n put(Operator.NOT_EQUALS, CompareFilter.CompareOp.NOT_EQUAL); // \"!=\"\n }});", "type": "Map<Operator, CompareFilter.CompareOp>", "var_name": "OPERATORS_MAP" }, { "declarator": "LOGICAL_OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, FilterList.Operator>() {{\n put(Operator.AND, FilterList.Operator.MUST_PASS_ALL);\n put(Operator.OR, FilterList.Operator.MUST_PASS_ONE);\n }})", "modifier": "private static final", "original_string": "private static final Map<Operator, FilterList.Operator> LOGICAL_OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, FilterList.Operator>() {{\n put(Operator.AND, FilterList.Operator.MUST_PASS_ALL);\n put(Operator.OR, FilterList.Operator.MUST_PASS_ONE);\n }});", "type": "Map<Operator, FilterList.Operator>", "var_name": "LOGICAL_OPERATORS_MAP" }, { "declarator": "endKeyAssigned = false", "modifier": "private", "original_string": "private boolean endKeyAssigned = false;", "type": "boolean", "var_name": "endKeyAssigned" }, { "declarator": "startKeyAssigned = false", "modifier": "private", "original_string": "private boolean startKeyAssigned = false;", "type": "boolean", "var_name": "startKeyAssigned" }, { "declarator": "endKey", "modifier": "private", "original_string": "private byte[] endKey;", "type": "byte[]", "var_name": "endKey" }, { "declarator": "startKey", "modifier": "private", "original_string": "private byte[] startKey;", "type": "byte[]", "var_name": "startKey" }, { "declarator": "filterQueue", "modifier": "private", "original_string": "private Deque<Filter> filterQueue;", "type": "Deque<Filter>", "var_name": "filterQueue" }, { "declarator": "currentFilter", "modifier": "private", "original_string": "private Filter currentFilter;", "type": "Filter", "var_name": "currentFilter" }, { "declarator": "tupleDescription", "modifier": "private", "original_string": "private HBaseTupleDescription tupleDescription;", "type": "HBaseTupleDescription", "var_name": "tupleDescription" } ], "file": "server/pxf-hbase/src/main/java/org/greenplum/pxf/plugins/hbase/HBaseFilterBuilder.java", "identifier": "HBaseFilterBuilder", "interfaces": "implements TreeVisitor", "methods": [ { "class_method_signature": "HBaseFilterBuilder.HBaseFilterBuilder(HBaseTupleDescription tupleDescription)", "constructor": true, "full_signature": "public HBaseFilterBuilder(HBaseTupleDescription tupleDescription)", "identifier": "HBaseFilterBuilder", "modifiers": "public", "parameters": "(HBaseTupleDescription tupleDescription)", "return": "", "signature": " HBaseFilterBuilder(HBaseTupleDescription tupleDescription)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.before(Node node, final int level)", "constructor": false, "full_signature": "@Override public Node before(Node node, final int level)", "identifier": "before", "modifiers": "@Override public", "parameters": "(Node node, final int level)", "return": "Node", "signature": "Node before(Node node, final int level)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.visit(Node node, final int level)", "constructor": false, "full_signature": "@Override public Node visit(Node node, final int level)", "identifier": "visit", "modifiers": "@Override public", "parameters": "(Node node, final int level)", "return": "Node", "signature": "Node visit(Node node, final int level)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.after(Node node, final int level)", "constructor": false, "full_signature": "@Override public Node after(Node node, final int level)", "identifier": "after", "modifiers": "@Override public", "parameters": "(Node node, final int level)", "return": "Node", "signature": "Node after(Node node, final int level)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.build()", "constructor": false, "full_signature": "public Filter build()", "identifier": "build", "modifiers": "public", "parameters": "()", "return": "Filter", "signature": "Filter build()", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.getStartKey()", "constructor": false, "full_signature": "public byte[] getStartKey()", "identifier": "getStartKey", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getStartKey()", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.getEndKey()", "constructor": false, "full_signature": "public byte[] getEndKey()", "identifier": "getEndKey", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getEndKey()", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.processFilter(Filter filter)", "constructor": false, "full_signature": "private void processFilter(Filter filter)", "identifier": "processFilter", "modifiers": "private", "parameters": "(Filter filter)", "return": "void", "signature": "void processFilter(Filter filter)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.processSimpleColumnOperator(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "constructor": false, "full_signature": "private Filter processSimpleColumnOperator(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "identifier": "processSimpleColumnOperator", "modifiers": "private", "parameters": "(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "return": "Filter", "signature": "Filter processSimpleColumnOperator(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.processNullOperator(HBaseColumnDescriptor hBaseColumn, Operator operator)", "constructor": false, "full_signature": "private Filter processNullOperator(HBaseColumnDescriptor hBaseColumn, Operator operator)", "identifier": "processNullOperator", "modifiers": "private", "parameters": "(HBaseColumnDescriptor hBaseColumn, Operator operator)", "return": "Filter", "signature": "Filter processNullOperator(HBaseColumnDescriptor hBaseColumn, Operator operator)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.isTextualRowKey(HBaseColumnDescriptor column)", "constructor": false, "full_signature": "private boolean isTextualRowKey(HBaseColumnDescriptor column)", "identifier": "isTextualRowKey", "modifiers": "private", "parameters": "(HBaseColumnDescriptor column)", "return": "boolean", "signature": "boolean isTextualRowKey(HBaseColumnDescriptor column)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.getComparator(int type, OperandNode data)", "constructor": false, "full_signature": "private ByteArrayComparable getComparator(int type, OperandNode data)", "identifier": "getComparator", "modifiers": "private", "parameters": "(int type, OperandNode data)", "return": "ByteArrayComparable", "signature": "ByteArrayComparable getComparator(int type, OperandNode data)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.storeStartEndKeys(Operator op, String data)", "constructor": false, "full_signature": "private void storeStartEndKeys(Operator op, String data)", "identifier": "storeStartEndKeys", "modifiers": "private", "parameters": "(Operator op, String data)", "return": "void", "signature": "void storeStartEndKeys(Operator op, String data)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.setStartKey(byte[] startKey)", "constructor": false, "full_signature": "private void setStartKey(byte[] startKey)", "identifier": "setStartKey", "modifiers": "private", "parameters": "(byte[] startKey)", "return": "void", "signature": "void setStartKey(byte[] startKey)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.setEndKey(byte[] endKey)", "constructor": false, "full_signature": "private void setEndKey(byte[] endKey)", "identifier": "setEndKey", "modifiers": "private", "parameters": "(byte[] endKey)", "return": "void", "signature": "void setEndKey(byte[] endKey)", "testcase": false } ], "superclass": "" }
{ "body": "private ByteArrayComparable getComparator(int type, OperandNode data) {\n ByteArrayComparable result;\n switch (DataType.get(type)) {\n case TEXT:\n result = new BinaryComparator(Bytes.toBytes(data.toString()));\n break;\n case SMALLINT:\n case INTEGER:\n result = new HBaseIntegerComparator(Long.parseLong(data.toString()));\n break;\n case BIGINT:\n case REAL:\n\n // Check the operand's original data type\n switch (data.getDataType()) {\n case BIGINT:\n case INTEGER:\n case SMALLINT:\n result = new HBaseIntegerComparator(Long.parseLong(data.toString()));\n break;\n case REAL:\n result = new HBaseFloatComparator(Float.parseFloat(data.toString()));\n break;\n case NUMERIC:\n case FLOAT8:\n result = new HBaseDoubleComparator(Double.parseDouble(data.toString()));\n break;\n default:\n result = null;\n break;\n }\n break;\n\n case FLOAT8:\n result = new HBaseDoubleComparator(Double.parseDouble(data.toString()));\n break;\n default:\n throw new IllegalArgumentException(String.format(\"unsupported column type for filtering %d\", type));\n }\n\n return result;\n }", "class_method_signature": "HBaseFilterBuilder.getComparator(int type, OperandNode data)", "constructor": false, "full_signature": "private ByteArrayComparable getComparator(int type, OperandNode data)", "identifier": "getComparator", "invocations": [ "get", "toBytes", "toString", "parseLong", "toString", "getDataType", "parseLong", "toString", "parseFloat", "toString", "parseDouble", "toString", "parseDouble", "toString", "format" ], "modifiers": "private", "parameters": "(int type, OperandNode data)", "return": "ByteArrayComparable", "signature": "ByteArrayComparable getComparator(int type, OperandNode data)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_9
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "factory", "modifier": "private", "original_string": "private BaseConfigurationFactory factory;", "type": "BaseConfigurationFactory", "var_name": "factory" }, { "declarator": "additionalProperties", "modifier": "private", "original_string": "private Map<String, String> additionalProperties;", "type": "Map<String, String>", "var_name": "additionalProperties" }, { "declarator": "mockServersDirectory", "modifier": "private", "original_string": "private File mockServersDirectory;", "type": "File", "var_name": "mockServersDirectory" }, { "declarator": "serversDirectory", "modifier": "private", "original_string": "private File serversDirectory;", "type": "File", "var_name": "serversDirectory" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/BaseConfigurationFactoryTest.java", "identifier": "BaseConfigurationFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigurationsLoadedAndOptionsAdded() {\n additionalProperties.put(\"test.newOption\", \"newOption\");\n additionalProperties.put(\"test.red\", \"purple\");\n additionalProperties.put(\"test.blue.key\", \"bluevaluechanged\");\n additionalProperties.put(\"test.user.key\", \"uservaluechanged\");\n Configuration configuration = factory.initConfiguration(\"default\", \"default\", \"dummy\", additionalProperties);\n\n assertEquals(\"blue\", configuration.get(\"test.blue\"));\n assertEquals(\"purple\", configuration.get(\"test.red\"));\n assertEquals(\"newOption\", configuration.get(\"test.newOption\"));\n\n // Should return null because the file name does not end in -site.xml\n assertNull(configuration.get(\"test.green\"));\n\n assertEquals(\"bluevaluefromuser\", configuration.get(\"test.blue.key\"));\n assertEquals(\"redvaluefromuser\", configuration.get(\"test.red.key\"));\n assertEquals(\"uservalue\", configuration.get(\"test.user.key\"));\n\n }", "class_method_signature": "BaseConfigurationFactoryTest.testConfigurationsLoadedAndOptionsAdded()", "constructor": false, "full_signature": "@Test public void testConfigurationsLoadedAndOptionsAdded()", "identifier": "testConfigurationsLoadedAndOptionsAdded", "invocations": [ "put", "put", "put", "put", "initConfiguration", "assertEquals", "get", "assertEquals", "get", "assertEquals", "get", "assertNull", "get", "assertEquals", "get", "assertEquals", "get", "assertEquals", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testConfigurationsLoadedAndOptionsAdded()", "testcase": true }
{ "fields": [ { "declarator": "instance = new BaseConfigurationFactory()", "modifier": "private static final", "original_string": "private static final BaseConfigurationFactory instance = new BaseConfigurationFactory();", "type": "BaseConfigurationFactory", "var_name": "instance" }, { "declarator": "LOG = LoggerFactory.getLogger(this.getClass())", "modifier": "protected final", "original_string": "protected final Logger LOG = LoggerFactory.getLogger(this.getClass());", "type": "Logger", "var_name": "LOG" }, { "declarator": "serversConfigDirectory", "modifier": "private final", "original_string": "private final File serversConfigDirectory;", "type": "File", "var_name": "serversConfigDirectory" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/BaseConfigurationFactory.java", "identifier": "BaseConfigurationFactory", "interfaces": "implements ConfigurationFactory", "methods": [ { "class_method_signature": "BaseConfigurationFactory.BaseConfigurationFactory()", "constructor": true, "full_signature": "public BaseConfigurationFactory()", "identifier": "BaseConfigurationFactory", "modifiers": "public", "parameters": "()", "return": "", "signature": " BaseConfigurationFactory()", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.BaseConfigurationFactory(File serversConfigDirectory)", "constructor": true, "full_signature": " BaseConfigurationFactory(File serversConfigDirectory)", "identifier": "BaseConfigurationFactory", "modifiers": "", "parameters": "(File serversConfigDirectory)", "return": "", "signature": " BaseConfigurationFactory(File serversConfigDirectory)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.getInstance()", "constructor": false, "full_signature": "public static BaseConfigurationFactory getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "BaseConfigurationFactory", "signature": "BaseConfigurationFactory getInstance()", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "constructor": false, "full_signature": "@Override public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "identifier": "initConfiguration", "modifiers": "@Override public", "parameters": "(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "return": "Configuration", "signature": "Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.processServerResources(Configuration configuration, String serverName, File directory)", "constructor": false, "full_signature": "private void processServerResources(Configuration configuration, String serverName, File directory)", "identifier": "processServerResources", "modifiers": "private", "parameters": "(Configuration configuration, String serverName, File directory)", "return": "void", "signature": "void processServerResources(Configuration configuration, String serverName, File directory)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.processUserResource(Configuration configuration, String serverName, String userName, File directory)", "constructor": false, "full_signature": "private void processUserResource(Configuration configuration, String serverName, String userName, File directory)", "identifier": "processUserResource", "modifiers": "private", "parameters": "(Configuration configuration, String serverName, String userName, File directory)", "return": "void", "signature": "void processUserResource(Configuration configuration, String serverName, String userName, File directory)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties) {\n // start with built-in Hadoop configuration that loads core-site.xml\n LOG.debug(\"Initializing configuration for server {}\", serverName);\n Configuration configuration = new Configuration();\n // while implementing multiple kerberized support we noticed that non-kerberized hadoop\n // access was trying to use SASL-client authentication. Setting the fallback to simple auth\n // allows us to still access non-kerberized hadoop clusters when there exists at least one\n // kerberized hadoop cluster. The root cause is that UGI has static fields and many hadoop\n // libraries depend on the state of the UGI\n // allow using SIMPLE auth for non-Kerberized HCFS access by SASL-enabled IPC client\n // that is created due to the fact that it uses UGI.isSecurityEnabled\n // and will try to use SASL if there is at least one Kerberized Hadoop cluster\n configuration.set(CommonConfigurationKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY, \"true\");\n\n // set synthetic property pxf.session.user so that is can be used in config files for interpolation in other properties\n // for example in JDBC when setting session authorization from a proxy user to the end-user\n configuration.set(PXF_SESSION_USER_PROPERTY, userName);\n\n File[] serverDirectories = null;\n Path p = Paths.get(configDirectory);\n\n if (p.isAbsolute()) {\n File f = p.toFile();\n if (f.exists() && f.isDirectory() && f.canRead()) {\n serverDirectories = new File[]{f};\n }\n } else {\n serverDirectories = serversConfigDirectory\n .listFiles(f ->\n f.isDirectory() &&\n f.canRead() &&\n StringUtils.equalsIgnoreCase(configDirectory, f.getName()));\n }\n\n if (ArrayUtils.isEmpty(serverDirectories)) {\n LOG.debug(\"Directory {}{}{} does not exist or cannot be read by PXF, no configuration resources are added for server {}\",\n serversConfigDirectory, File.separator, configDirectory, serverName);\n } else if (serverDirectories.length > 1) {\n throw new IllegalStateException(String.format(\n \"Multiple directories found for server %s. Server directories are expected to be case-insensitive.\", serverName\n ));\n } else {\n // add all site files as URL resources to the configuration, no resources will be added from the classpath\n LOG.debug(\"Using directory {} for server {} configuration\", serverDirectories[0], serverName);\n processServerResources(configuration, serverName, serverDirectories[0]);\n }\n\n // add additional properties, if provided\n if (additionalProperties != null) {\n LOG.debug(\"Adding {} additional properties to configuration for server {}\", additionalProperties.size(), serverName);\n additionalProperties.forEach(configuration::set);\n }\n\n // add user configuration\n if (!ArrayUtils.isEmpty(serverDirectories)) {\n processUserResource(configuration, serverName, userName, serverDirectories[0]);\n }\n\n try {\n // We need to set the restrict system properties to false so\n // variables in the configuration get replaced by system property\n // values\n configuration.setRestrictSystemProps(false);\n } catch (NoSuchMethodError e) {\n // Expected exception for MapR\n }\n\n return configuration;\n }", "class_method_signature": "BaseConfigurationFactory.initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "constructor": false, "full_signature": "@Override public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "identifier": "initConfiguration", "invocations": [ "debug", "set", "set", "get", "isAbsolute", "toFile", "exists", "isDirectory", "canRead", "listFiles", "isDirectory", "canRead", "equalsIgnoreCase", "getName", "isEmpty", "debug", "format", "debug", "processServerResources", "debug", "size", "forEach", "isEmpty", "processUserResource", "setRestrictSystemProps" ], "modifiers": "@Override public", "parameters": "(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "return": "Configuration", "signature": "Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_17
{ "fields": [], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/FragmentStatsTest.java", "identifier": "FragmentStatsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void dataToString() {\n FragmentStats fragmentStats = new FragmentStats(25, 2000000000, (long) Math.pow(5, 30));\n String path = \"la la la\";\n String str = FragmentStats.dataToString(fragmentStats, path);\n String expected = \"Statistics information for \\\"\" + path + \"\\\" \"\n + \" Number of Fragments: \" + 25\n + \", first Fragment size: \" + 1953125 + \"KB\"\n + \", total size: \" + 8388607 + \"TB\";\n assertEquals(expected, str);\n }", "class_method_signature": "FragmentStatsTest.dataToString()", "constructor": false, "full_signature": "@Test public void dataToString()", "identifier": "dataToString", "invocations": [ "pow", "dataToString", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void dataToString()", "testcase": true }
{ "fields": [ { "declarator": "DEFAULT_FRAGMENT_SIZE = 67108864L", "modifier": "public static final", "original_string": "public static final long DEFAULT_FRAGMENT_SIZE = 67108864L;", "type": "long", "var_name": "DEFAULT_FRAGMENT_SIZE" }, { "declarator": "LOG = LogFactory.getLog(FragmentStats.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(FragmentStats.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "fragmentsNumber", "modifier": "private", "original_string": "private long fragmentsNumber;", "type": "long", "var_name": "fragmentsNumber" }, { "declarator": "firstFragmentSize", "modifier": "private", "original_string": "private SizeAndUnit firstFragmentSize;", "type": "SizeAndUnit", "var_name": "firstFragmentSize" }, { "declarator": "totalSize", "modifier": "private", "original_string": "private SizeAndUnit totalSize;", "type": "SizeAndUnit", "var_name": "totalSize" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/FragmentStats.java", "identifier": "FragmentStats", "interfaces": "", "methods": [ { "class_method_signature": "FragmentStats.FragmentStats(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "constructor": true, "full_signature": "public FragmentStats(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "identifier": "FragmentStats", "modifiers": "public", "parameters": "(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "return": "", "signature": " FragmentStats(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "testcase": false }, { "class_method_signature": "FragmentStats.dataToJSON(FragmentStats stats)", "constructor": false, "full_signature": "public static String dataToJSON(FragmentStats stats)", "identifier": "dataToJSON", "modifiers": "public static", "parameters": "(FragmentStats stats)", "return": "String", "signature": "String dataToJSON(FragmentStats stats)", "testcase": false }, { "class_method_signature": "FragmentStats.dataToString(FragmentStats stats, String datapath)", "constructor": false, "full_signature": "public static String dataToString(FragmentStats stats, String datapath)", "identifier": "dataToString", "modifiers": "public static", "parameters": "(FragmentStats stats, String datapath)", "return": "String", "signature": "String dataToString(FragmentStats stats, String datapath)", "testcase": false }, { "class_method_signature": "FragmentStats.getFragmentsNumber()", "constructor": false, "full_signature": "public long getFragmentsNumber()", "identifier": "getFragmentsNumber", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getFragmentsNumber()", "testcase": false }, { "class_method_signature": "FragmentStats.setFragmentsNumber(long fragmentsNumber)", "constructor": false, "full_signature": "private void setFragmentsNumber(long fragmentsNumber)", "identifier": "setFragmentsNumber", "modifiers": "private", "parameters": "(long fragmentsNumber)", "return": "void", "signature": "void setFragmentsNumber(long fragmentsNumber)", "testcase": false }, { "class_method_signature": "FragmentStats.getFirstFragmentSize()", "constructor": false, "full_signature": "public SizeAndUnit getFirstFragmentSize()", "identifier": "getFirstFragmentSize", "modifiers": "public", "parameters": "()", "return": "SizeAndUnit", "signature": "SizeAndUnit getFirstFragmentSize()", "testcase": false }, { "class_method_signature": "FragmentStats.setFirstFragmentSize(long firstFragmentSize)", "constructor": false, "full_signature": "private void setFirstFragmentSize(long firstFragmentSize)", "identifier": "setFirstFragmentSize", "modifiers": "private", "parameters": "(long firstFragmentSize)", "return": "void", "signature": "void setFirstFragmentSize(long firstFragmentSize)", "testcase": false }, { "class_method_signature": "FragmentStats.getTotalSize()", "constructor": false, "full_signature": "public SizeAndUnit getTotalSize()", "identifier": "getTotalSize", "modifiers": "public", "parameters": "()", "return": "SizeAndUnit", "signature": "SizeAndUnit getTotalSize()", "testcase": false }, { "class_method_signature": "FragmentStats.setTotalSize(long totalSize)", "constructor": false, "full_signature": "private void setTotalSize(long totalSize)", "identifier": "setTotalSize", "modifiers": "private", "parameters": "(long totalSize)", "return": "void", "signature": "void setTotalSize(long totalSize)", "testcase": false }, { "class_method_signature": "FragmentStats.setSizeAndUnit(long originalSize)", "constructor": false, "full_signature": "private SizeAndUnit setSizeAndUnit(long originalSize)", "identifier": "setSizeAndUnit", "modifiers": "private", "parameters": "(long originalSize)", "return": "SizeAndUnit", "signature": "SizeAndUnit setSizeAndUnit(long originalSize)", "testcase": false }, { "class_method_signature": "FragmentStats.getSizeUnit(int orderOfMagnitude)", "constructor": false, "full_signature": "private SizeUnit getSizeUnit(int orderOfMagnitude)", "identifier": "getSizeUnit", "modifiers": "private", "parameters": "(int orderOfMagnitude)", "return": "SizeUnit", "signature": "SizeUnit getSizeUnit(int orderOfMagnitude)", "testcase": false } ], "superclass": "" }
{ "body": "public static String dataToString(FragmentStats stats, String datapath) {\n return \"Statistics information for \\\"\" + datapath + \"\\\" \"\n + \" Number of Fragments: \" + stats.fragmentsNumber\n + \", first Fragment size: \" + stats.firstFragmentSize\n + \", total size: \" + stats.totalSize;\n }", "class_method_signature": "FragmentStats.dataToString(FragmentStats stats, String datapath)", "constructor": false, "full_signature": "public static String dataToString(FragmentStats stats, String datapath)", "identifier": "dataToString", "invocations": [], "modifiers": "public static", "parameters": "(FragmentStats stats, String datapath)", "return": "String", "signature": "String dataToString(FragmentStats stats, String datapath)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_327
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "mockHiveClient", "modifier": "private", "original_string": "private HiveMetaStoreClient mockHiveClient;", "type": "HiveMetaStoreClient", "var_name": "mockHiveClient" }, { "declarator": "fetcher", "modifier": "private", "original_string": "private HiveMetadataFetcher fetcher;", "type": "HiveMetadataFetcher", "var_name": "fetcher" }, { "declarator": "metadataList", "modifier": "private", "original_string": "private List<Metadata> metadataList;", "type": "List<Metadata>", "var_name": "metadataList" }, { "declarator": "fakeHiveClientWrapper", "modifier": "private", "original_string": "private HiveClientWrapper fakeHiveClientWrapper;", "type": "HiveClientWrapper", "var_name": "fakeHiveClientWrapper" }, { "declarator": "mockConfigurationFactory", "modifier": "private", "original_string": "private ConfigurationFactory mockConfigurationFactory;", "type": "ConfigurationFactory", "var_name": "mockConfigurationFactory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "mockClientFactory", "modifier": "private", "original_string": "private HiveClientWrapper.HiveClientFactory mockClientFactory;", "type": "HiveClientWrapper.HiveClientFactory", "var_name": "mockClientFactory" } ], "file": "server/pxf-hive/src/test/java/org/greenplum/pxf/plugins/hive/HiveMetadataFetcherTest.java", "identifier": "HiveMetadataFetcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getTableMetadata() throws Exception {\n\n fetcher = new HiveMetadataFetcher(context, mockConfigurationFactory, fakeHiveClientWrapper);\n String tableName = \"cause\";\n\n // mock hive table returned from hive client\n List<FieldSchema> fields = new ArrayList<>();\n fields.add(new FieldSchema(\"field1\", \"string\", null));\n fields.add(new FieldSchema(\"field2\", \"int\", null));\n StorageDescriptor sd = new StorageDescriptor();\n sd.setCols(fields);\n sd.setInputFormat(\"org.apache.hadoop.mapred.TextInputFormat\");\n Table hiveTable = new Table();\n hiveTable.setTableType(\"MANAGED_TABLE\");\n hiveTable.setSd(sd);\n hiveTable.setPartitionKeys(new ArrayList<>());\n when(mockHiveClient.getTable(\"default\", tableName)).thenReturn(hiveTable);\n\n // Get metadata\n metadataList = fetcher.getMetadata(tableName);\n Metadata metadata = metadataList.get(0);\n\n assertEquals(\"default.cause\", metadata.getItem().toString());\n\n List<Metadata.Field> resultFields = metadata.getFields();\n assertNotNull(resultFields);\n assertEquals(2, resultFields.size());\n Metadata.Field field = resultFields.get(0);\n assertEquals(\"field1\", field.getName());\n assertEquals(\"text\", field.getType().getTypeName()); // converted type\n field = resultFields.get(1);\n assertEquals(\"field2\", field.getName());\n assertEquals(\"int4\", field.getType().getTypeName());\n }", "class_method_signature": "HiveMetadataFetcherTest.getTableMetadata()", "constructor": false, "full_signature": "@Test public void getTableMetadata()", "identifier": "getTableMetadata", "invocations": [ "add", "add", "setCols", "setInputFormat", "setTableType", "setSd", "setPartitionKeys", "thenReturn", "when", "getTable", "getMetadata", "get", "assertEquals", "toString", "getItem", "getFields", "assertNotNull", "assertEquals", "size", "get", "assertEquals", "getName", "assertEquals", "getTypeName", "getType", "get", "assertEquals", "getName", "assertEquals", "getTypeName", "getType" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getTableMetadata()", "testcase": true }
{ "fields": [ { "declarator": "DELIM_FIELD = \"DELIMITER\"", "modifier": "private static final", "original_string": "private static final String DELIM_FIELD = \"DELIMITER\";", "type": "String", "var_name": "DELIM_FIELD" }, { "declarator": "LOG = LogFactory.getLog(HiveMetadataFetcher.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(HiveMetadataFetcher.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "client", "modifier": "private", "original_string": "private IMetaStoreClient client;", "type": "IMetaStoreClient", "var_name": "client" }, { "declarator": "jobConf", "modifier": "private", "original_string": "private JobConf jobConf;", "type": "JobConf", "var_name": "jobConf" }, { "declarator": "hiveClientWrapper", "modifier": "private", "original_string": "private HiveClientWrapper hiveClientWrapper;", "type": "HiveClientWrapper", "var_name": "hiveClientWrapper" } ], "file": "server/pxf-hive/src/main/java/org/greenplum/pxf/plugins/hive/HiveMetadataFetcher.java", "identifier": "HiveMetadataFetcher", "interfaces": "implements MetadataFetcher", "methods": [ { "class_method_signature": "HiveMetadataFetcher.HiveMetadataFetcher(RequestContext context)", "constructor": true, "full_signature": "public HiveMetadataFetcher(RequestContext context)", "identifier": "HiveMetadataFetcher", "modifiers": "public", "parameters": "(RequestContext context)", "return": "", "signature": " HiveMetadataFetcher(RequestContext context)", "testcase": false }, { "class_method_signature": "HiveMetadataFetcher.HiveMetadataFetcher(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "constructor": true, "full_signature": " HiveMetadataFetcher(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "identifier": "HiveMetadataFetcher", "modifiers": "", "parameters": "(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "return": "", "signature": " HiveMetadataFetcher(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "testcase": false }, { "class_method_signature": "HiveMetadataFetcher.getMetadata(String pattern)", "constructor": false, "full_signature": "@Override public List<Metadata> getMetadata(String pattern)", "identifier": "getMetadata", "modifiers": "@Override public", "parameters": "(String pattern)", "return": "List<Metadata>", "signature": "List<Metadata> getMetadata(String pattern)", "testcase": false }, { "class_method_signature": "HiveMetadataFetcher.getOutputFormat(String inputFormat, boolean hasComplexTypes)", "constructor": false, "full_signature": "private OutputFormat getOutputFormat(String inputFormat, boolean hasComplexTypes)", "identifier": "getOutputFormat", "modifiers": "private", "parameters": "(String inputFormat, boolean hasComplexTypes)", "return": "OutputFormat", "signature": "OutputFormat getOutputFormat(String inputFormat, boolean hasComplexTypes)", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "@Override\n public List<Metadata> getMetadata(String pattern) throws Exception {\n\n boolean ignoreErrors = false;\n List<Metadata.Item> tblsDesc = hiveClientWrapper.extractTablesFromPattern(client, pattern);\n\n if (tblsDesc == null || tblsDesc.isEmpty()) {\n LOG.warn(\"No tables found for the given pattern: \" + pattern);\n return null;\n }\n\n List<Metadata> metadataList = new ArrayList<>();\n\n if (tblsDesc.size() > 1) {\n ignoreErrors = true;\n }\n\n for (Metadata.Item tblDesc : tblsDesc) {\n try {\n Metadata metadata = new Metadata(tblDesc);\n Table tbl = hiveClientWrapper.getHiveTable(client, tblDesc);\n hiveClientWrapper.getSchema(tbl, metadata);\n boolean hasComplexTypes = hiveClientWrapper.hasComplexTypes(metadata);\n metadataList.add(metadata);\n List<Partition> tablePartitions = client.listPartitionsByFilter(tblDesc.getPath(), tblDesc.getName(), \"\", (short) -1);\n Set<OutputFormat> formats = new HashSet<>();\n //If table has partitions - find out all formats\n for (Partition tablePartition : tablePartitions) {\n String inputFormat = tablePartition.getSd().getInputFormat();\n OutputFormat outputFormat = getOutputFormat(inputFormat, hasComplexTypes);\n formats.add(outputFormat);\n }\n //If table has no partitions - get single format of table\n if (tablePartitions.size() == 0) {\n String inputFormat = tbl.getSd().getInputFormat();\n OutputFormat outputFormat = getOutputFormat(inputFormat, hasComplexTypes);\n formats.add(outputFormat);\n }\n metadata.setOutputFormats(formats);\n Map<String, String> outputParameters = new HashMap<>();\n Integer delimiterCode = hiveClientWrapper.getDelimiterCode(tbl.getSd());\n outputParameters.put(DELIM_FIELD, delimiterCode.toString());\n metadata.setOutputParameters(outputParameters);\n } catch (UnsupportedTypeException | UnsupportedOperationException e) {\n if (ignoreErrors) {\n LOG.warn(\"Metadata fetch for \" + tblDesc.toString() + \" failed. \" + e.getMessage());\n } else {\n throw e;\n }\n }\n }\n\n return metadataList;\n }", "class_method_signature": "HiveMetadataFetcher.getMetadata(String pattern)", "constructor": false, "full_signature": "@Override public List<Metadata> getMetadata(String pattern)", "identifier": "getMetadata", "invocations": [ "extractTablesFromPattern", "isEmpty", "warn", "size", "getHiveTable", "getSchema", "hasComplexTypes", "add", "listPartitionsByFilter", "getPath", "getName", "getInputFormat", "getSd", "getOutputFormat", "add", "size", "getInputFormat", "getSd", "getOutputFormat", "add", "setOutputFormats", "getDelimiterCode", "getSd", "put", "toString", "setOutputParameters", "warn", "toString", "getMessage" ], "modifiers": "@Override public", "parameters": "(String pattern)", "return": "List<Metadata>", "signature": "List<Metadata> getMetadata(String pattern)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_262
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile() {\n context.setRequestType(RequestContext.RequestType.WRITE_BRIDGE);\n context.addOption(\"SCHEMA\", avroDirectory + \"user-provided.avsc\");\n\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifySchema(schema, \"user_provided_schema\");\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile()", "identifier": "testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile", "invocations": [ "setRequestType", "addOption", "obtainSchema", "verifySchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_326
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "mockHiveClient", "modifier": "private", "original_string": "private HiveMetaStoreClient mockHiveClient;", "type": "HiveMetaStoreClient", "var_name": "mockHiveClient" }, { "declarator": "fetcher", "modifier": "private", "original_string": "private HiveMetadataFetcher fetcher;", "type": "HiveMetadataFetcher", "var_name": "fetcher" }, { "declarator": "metadataList", "modifier": "private", "original_string": "private List<Metadata> metadataList;", "type": "List<Metadata>", "var_name": "metadataList" }, { "declarator": "fakeHiveClientWrapper", "modifier": "private", "original_string": "private HiveClientWrapper fakeHiveClientWrapper;", "type": "HiveClientWrapper", "var_name": "fakeHiveClientWrapper" }, { "declarator": "mockConfigurationFactory", "modifier": "private", "original_string": "private ConfigurationFactory mockConfigurationFactory;", "type": "ConfigurationFactory", "var_name": "mockConfigurationFactory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "mockClientFactory", "modifier": "private", "original_string": "private HiveClientWrapper.HiveClientFactory mockClientFactory;", "type": "HiveClientWrapper.HiveClientFactory", "var_name": "mockClientFactory" } ], "file": "server/pxf-hive/src/test/java/org/greenplum/pxf/plugins/hive/HiveMetadataFetcherTest.java", "identifier": "HiveMetadataFetcherTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getTableMetadataView() throws Exception {\n expectedException.expect(UnsupportedOperationException.class);\n expectedException.expectMessage(\"Hive views are not supported by PXF\");\n\n String tableName = \"cause\";\n fetcher = new HiveMetadataFetcher(context, mockConfigurationFactory, fakeHiveClientWrapper);\n\n // mock hive table returned from hive client\n Table hiveTable = new Table();\n hiveTable.setTableType(\"VIRTUAL_VIEW\");\n when(mockHiveClient.getTable(\"default\", tableName)).thenReturn(hiveTable);\n\n metadataList = fetcher.getMetadata(tableName);\n }", "class_method_signature": "HiveMetadataFetcherTest.getTableMetadataView()", "constructor": false, "full_signature": "@Test public void getTableMetadataView()", "identifier": "getTableMetadataView", "invocations": [ "expect", "expectMessage", "setTableType", "thenReturn", "when", "getTable", "getMetadata" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getTableMetadataView()", "testcase": true }
{ "fields": [ { "declarator": "DELIM_FIELD = \"DELIMITER\"", "modifier": "private static final", "original_string": "private static final String DELIM_FIELD = \"DELIMITER\";", "type": "String", "var_name": "DELIM_FIELD" }, { "declarator": "LOG = LogFactory.getLog(HiveMetadataFetcher.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(HiveMetadataFetcher.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "client", "modifier": "private", "original_string": "private IMetaStoreClient client;", "type": "IMetaStoreClient", "var_name": "client" }, { "declarator": "jobConf", "modifier": "private", "original_string": "private JobConf jobConf;", "type": "JobConf", "var_name": "jobConf" }, { "declarator": "hiveClientWrapper", "modifier": "private", "original_string": "private HiveClientWrapper hiveClientWrapper;", "type": "HiveClientWrapper", "var_name": "hiveClientWrapper" } ], "file": "server/pxf-hive/src/main/java/org/greenplum/pxf/plugins/hive/HiveMetadataFetcher.java", "identifier": "HiveMetadataFetcher", "interfaces": "implements MetadataFetcher", "methods": [ { "class_method_signature": "HiveMetadataFetcher.HiveMetadataFetcher(RequestContext context)", "constructor": true, "full_signature": "public HiveMetadataFetcher(RequestContext context)", "identifier": "HiveMetadataFetcher", "modifiers": "public", "parameters": "(RequestContext context)", "return": "", "signature": " HiveMetadataFetcher(RequestContext context)", "testcase": false }, { "class_method_signature": "HiveMetadataFetcher.HiveMetadataFetcher(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "constructor": true, "full_signature": " HiveMetadataFetcher(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "identifier": "HiveMetadataFetcher", "modifiers": "", "parameters": "(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "return": "", "signature": " HiveMetadataFetcher(RequestContext context, ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "testcase": false }, { "class_method_signature": "HiveMetadataFetcher.getMetadata(String pattern)", "constructor": false, "full_signature": "@Override public List<Metadata> getMetadata(String pattern)", "identifier": "getMetadata", "modifiers": "@Override public", "parameters": "(String pattern)", "return": "List<Metadata>", "signature": "List<Metadata> getMetadata(String pattern)", "testcase": false }, { "class_method_signature": "HiveMetadataFetcher.getOutputFormat(String inputFormat, boolean hasComplexTypes)", "constructor": false, "full_signature": "private OutputFormat getOutputFormat(String inputFormat, boolean hasComplexTypes)", "identifier": "getOutputFormat", "modifiers": "private", "parameters": "(String inputFormat, boolean hasComplexTypes)", "return": "OutputFormat", "signature": "OutputFormat getOutputFormat(String inputFormat, boolean hasComplexTypes)", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "@Override\n public List<Metadata> getMetadata(String pattern) throws Exception {\n\n boolean ignoreErrors = false;\n List<Metadata.Item> tblsDesc = hiveClientWrapper.extractTablesFromPattern(client, pattern);\n\n if (tblsDesc == null || tblsDesc.isEmpty()) {\n LOG.warn(\"No tables found for the given pattern: \" + pattern);\n return null;\n }\n\n List<Metadata> metadataList = new ArrayList<>();\n\n if (tblsDesc.size() > 1) {\n ignoreErrors = true;\n }\n\n for (Metadata.Item tblDesc : tblsDesc) {\n try {\n Metadata metadata = new Metadata(tblDesc);\n Table tbl = hiveClientWrapper.getHiveTable(client, tblDesc);\n hiveClientWrapper.getSchema(tbl, metadata);\n boolean hasComplexTypes = hiveClientWrapper.hasComplexTypes(metadata);\n metadataList.add(metadata);\n List<Partition> tablePartitions = client.listPartitionsByFilter(tblDesc.getPath(), tblDesc.getName(), \"\", (short) -1);\n Set<OutputFormat> formats = new HashSet<>();\n //If table has partitions - find out all formats\n for (Partition tablePartition : tablePartitions) {\n String inputFormat = tablePartition.getSd().getInputFormat();\n OutputFormat outputFormat = getOutputFormat(inputFormat, hasComplexTypes);\n formats.add(outputFormat);\n }\n //If table has no partitions - get single format of table\n if (tablePartitions.size() == 0) {\n String inputFormat = tbl.getSd().getInputFormat();\n OutputFormat outputFormat = getOutputFormat(inputFormat, hasComplexTypes);\n formats.add(outputFormat);\n }\n metadata.setOutputFormats(formats);\n Map<String, String> outputParameters = new HashMap<>();\n Integer delimiterCode = hiveClientWrapper.getDelimiterCode(tbl.getSd());\n outputParameters.put(DELIM_FIELD, delimiterCode.toString());\n metadata.setOutputParameters(outputParameters);\n } catch (UnsupportedTypeException | UnsupportedOperationException e) {\n if (ignoreErrors) {\n LOG.warn(\"Metadata fetch for \" + tblDesc.toString() + \" failed. \" + e.getMessage());\n } else {\n throw e;\n }\n }\n }\n\n return metadataList;\n }", "class_method_signature": "HiveMetadataFetcher.getMetadata(String pattern)", "constructor": false, "full_signature": "@Override public List<Metadata> getMetadata(String pattern)", "identifier": "getMetadata", "invocations": [ "extractTablesFromPattern", "isEmpty", "warn", "size", "getHiveTable", "getSchema", "hasComplexTypes", "add", "listPartitionsByFilter", "getPath", "getName", "getInputFormat", "getSd", "getOutputFormat", "add", "size", "getInputFormat", "getSd", "getOutputFormat", "add", "setOutputFormats", "getDelimiterCode", "getSd", "put", "toString", "setOutputParameters", "warn", "toString", "getMessage" ], "modifiers": "@Override public", "parameters": "(String pattern)", "return": "List<Metadata>", "signature": "List<Metadata> getMetadata(String pattern)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_263
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile_Spaces() {\n context.setRequestType(RequestContext.RequestType.WRITE_BRIDGE);\n context.addOption(\"SCHEMA\", avroDirectory + \"user provided.avsc\");\n\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifySchema(schema, \"user_provided_schema\");\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile_Spaces()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile_Spaces()", "identifier": "testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile_Spaces", "invocations": [ "setRequestType", "addOption", "obtainSchema", "verifySchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_FullPathToLocalFile_Spaces()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_8
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "factory", "modifier": "private", "original_string": "private BaseConfigurationFactory factory;", "type": "BaseConfigurationFactory", "var_name": "factory" }, { "declarator": "additionalProperties", "modifier": "private", "original_string": "private Map<String, String> additionalProperties;", "type": "Map<String, String>", "var_name": "additionalProperties" }, { "declarator": "mockServersDirectory", "modifier": "private", "original_string": "private File mockServersDirectory;", "type": "File", "var_name": "mockServersDirectory" }, { "declarator": "serversDirectory", "modifier": "private", "original_string": "private File serversDirectory;", "type": "File", "var_name": "serversDirectory" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/BaseConfigurationFactoryTest.java", "identifier": "BaseConfigurationFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigurationsLoadedForCaseInsensitiveServerName() {\n Configuration configuration = factory.initConfiguration(\"DeFAulT\", \"DeFAulT\", \"dummy\", null);\n\n assertEquals(\"blue\", configuration.get(\"test.blue\"));\n assertEquals(\"red\", configuration.get(\"test.red\"));\n\n // Should return null because the file name does not end in -site.xml\n assertNull(configuration.get(\"test.green\"));\n\n assertEquals(\"bluevaluefromuser\", configuration.get(\"test.blue.key\"));\n assertEquals(\"redvaluefromuser\", configuration.get(\"test.red.key\"));\n assertEquals(\"uservalue\", configuration.get(\"test.user.key\"));\n }", "class_method_signature": "BaseConfigurationFactoryTest.testConfigurationsLoadedForCaseInsensitiveServerName()", "constructor": false, "full_signature": "@Test public void testConfigurationsLoadedForCaseInsensitiveServerName()", "identifier": "testConfigurationsLoadedForCaseInsensitiveServerName", "invocations": [ "initConfiguration", "assertEquals", "get", "assertEquals", "get", "assertNull", "get", "assertEquals", "get", "assertEquals", "get", "assertEquals", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testConfigurationsLoadedForCaseInsensitiveServerName()", "testcase": true }
{ "fields": [ { "declarator": "instance = new BaseConfigurationFactory()", "modifier": "private static final", "original_string": "private static final BaseConfigurationFactory instance = new BaseConfigurationFactory();", "type": "BaseConfigurationFactory", "var_name": "instance" }, { "declarator": "LOG = LoggerFactory.getLogger(this.getClass())", "modifier": "protected final", "original_string": "protected final Logger LOG = LoggerFactory.getLogger(this.getClass());", "type": "Logger", "var_name": "LOG" }, { "declarator": "serversConfigDirectory", "modifier": "private final", "original_string": "private final File serversConfigDirectory;", "type": "File", "var_name": "serversConfigDirectory" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/BaseConfigurationFactory.java", "identifier": "BaseConfigurationFactory", "interfaces": "implements ConfigurationFactory", "methods": [ { "class_method_signature": "BaseConfigurationFactory.BaseConfigurationFactory()", "constructor": true, "full_signature": "public BaseConfigurationFactory()", "identifier": "BaseConfigurationFactory", "modifiers": "public", "parameters": "()", "return": "", "signature": " BaseConfigurationFactory()", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.BaseConfigurationFactory(File serversConfigDirectory)", "constructor": true, "full_signature": " BaseConfigurationFactory(File serversConfigDirectory)", "identifier": "BaseConfigurationFactory", "modifiers": "", "parameters": "(File serversConfigDirectory)", "return": "", "signature": " BaseConfigurationFactory(File serversConfigDirectory)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.getInstance()", "constructor": false, "full_signature": "public static BaseConfigurationFactory getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "BaseConfigurationFactory", "signature": "BaseConfigurationFactory getInstance()", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "constructor": false, "full_signature": "@Override public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "identifier": "initConfiguration", "modifiers": "@Override public", "parameters": "(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "return": "Configuration", "signature": "Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.processServerResources(Configuration configuration, String serverName, File directory)", "constructor": false, "full_signature": "private void processServerResources(Configuration configuration, String serverName, File directory)", "identifier": "processServerResources", "modifiers": "private", "parameters": "(Configuration configuration, String serverName, File directory)", "return": "void", "signature": "void processServerResources(Configuration configuration, String serverName, File directory)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.processUserResource(Configuration configuration, String serverName, String userName, File directory)", "constructor": false, "full_signature": "private void processUserResource(Configuration configuration, String serverName, String userName, File directory)", "identifier": "processUserResource", "modifiers": "private", "parameters": "(Configuration configuration, String serverName, String userName, File directory)", "return": "void", "signature": "void processUserResource(Configuration configuration, String serverName, String userName, File directory)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties) {\n // start with built-in Hadoop configuration that loads core-site.xml\n LOG.debug(\"Initializing configuration for server {}\", serverName);\n Configuration configuration = new Configuration();\n // while implementing multiple kerberized support we noticed that non-kerberized hadoop\n // access was trying to use SASL-client authentication. Setting the fallback to simple auth\n // allows us to still access non-kerberized hadoop clusters when there exists at least one\n // kerberized hadoop cluster. The root cause is that UGI has static fields and many hadoop\n // libraries depend on the state of the UGI\n // allow using SIMPLE auth for non-Kerberized HCFS access by SASL-enabled IPC client\n // that is created due to the fact that it uses UGI.isSecurityEnabled\n // and will try to use SASL if there is at least one Kerberized Hadoop cluster\n configuration.set(CommonConfigurationKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY, \"true\");\n\n // set synthetic property pxf.session.user so that is can be used in config files for interpolation in other properties\n // for example in JDBC when setting session authorization from a proxy user to the end-user\n configuration.set(PXF_SESSION_USER_PROPERTY, userName);\n\n File[] serverDirectories = null;\n Path p = Paths.get(configDirectory);\n\n if (p.isAbsolute()) {\n File f = p.toFile();\n if (f.exists() && f.isDirectory() && f.canRead()) {\n serverDirectories = new File[]{f};\n }\n } else {\n serverDirectories = serversConfigDirectory\n .listFiles(f ->\n f.isDirectory() &&\n f.canRead() &&\n StringUtils.equalsIgnoreCase(configDirectory, f.getName()));\n }\n\n if (ArrayUtils.isEmpty(serverDirectories)) {\n LOG.debug(\"Directory {}{}{} does not exist or cannot be read by PXF, no configuration resources are added for server {}\",\n serversConfigDirectory, File.separator, configDirectory, serverName);\n } else if (serverDirectories.length > 1) {\n throw new IllegalStateException(String.format(\n \"Multiple directories found for server %s. Server directories are expected to be case-insensitive.\", serverName\n ));\n } else {\n // add all site files as URL resources to the configuration, no resources will be added from the classpath\n LOG.debug(\"Using directory {} for server {} configuration\", serverDirectories[0], serverName);\n processServerResources(configuration, serverName, serverDirectories[0]);\n }\n\n // add additional properties, if provided\n if (additionalProperties != null) {\n LOG.debug(\"Adding {} additional properties to configuration for server {}\", additionalProperties.size(), serverName);\n additionalProperties.forEach(configuration::set);\n }\n\n // add user configuration\n if (!ArrayUtils.isEmpty(serverDirectories)) {\n processUserResource(configuration, serverName, userName, serverDirectories[0]);\n }\n\n try {\n // We need to set the restrict system properties to false so\n // variables in the configuration get replaced by system property\n // values\n configuration.setRestrictSystemProps(false);\n } catch (NoSuchMethodError e) {\n // Expected exception for MapR\n }\n\n return configuration;\n }", "class_method_signature": "BaseConfigurationFactory.initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "constructor": false, "full_signature": "@Override public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "identifier": "initConfiguration", "invocations": [ "debug", "set", "set", "get", "isAbsolute", "toFile", "exists", "isDirectory", "canRead", "listFiles", "isDirectory", "canRead", "equalsIgnoreCase", "getName", "isEmpty", "debug", "format", "debug", "processServerResources", "debug", "size", "forEach", "isEmpty", "processUserResource", "setRestrictSystemProps" ], "modifiers": "@Override public", "parameters": "(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "return": "Configuration", "signature": "Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_16
{ "fields": [], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/FragmentStatsTest.java", "identifier": "FragmentStatsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void dataToJSON() throws IOException {\n FragmentStats fragmentStats = new FragmentStats(25, 20000000, (long) Math.pow(5, 30));\n String json = FragmentStats.dataToJSON(fragmentStats);\n String expectedJson = \"{\\\"PXFFragmentsStats\\\":\" +\n \"{\\\"fragmentsNumber\\\":\" + fragmentStats.getFragmentsNumber() +\n \",\\\"firstFragmentSize\\\":\" +\n \"{\\\"size\\\":\" + fragmentStats.getFirstFragmentSize().getSize() +\n \",\\\"unit\\\":\\\"\" + fragmentStats.getFirstFragmentSize().getUnit() + \"\\\"}\" +\n \",\\\"totalSize\\\":\" +\n \"{\\\"size\\\":\" + fragmentStats.getTotalSize().getSize() +\n \",\\\"unit\\\":\\\"\" + fragmentStats.getTotalSize().getUnit() + \"\\\"}\" +\n \"}}\";\n assertEquals(expectedJson, json);\n }", "class_method_signature": "FragmentStatsTest.dataToJSON()", "constructor": false, "full_signature": "@Test public void dataToJSON()", "identifier": "dataToJSON", "invocations": [ "pow", "dataToJSON", "getFragmentsNumber", "getSize", "getFirstFragmentSize", "getUnit", "getFirstFragmentSize", "getSize", "getTotalSize", "getUnit", "getTotalSize", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void dataToJSON()", "testcase": true }
{ "fields": [ { "declarator": "DEFAULT_FRAGMENT_SIZE = 67108864L", "modifier": "public static final", "original_string": "public static final long DEFAULT_FRAGMENT_SIZE = 67108864L;", "type": "long", "var_name": "DEFAULT_FRAGMENT_SIZE" }, { "declarator": "LOG = LogFactory.getLog(FragmentStats.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(FragmentStats.class);", "type": "Log", "var_name": "LOG" }, { "declarator": "fragmentsNumber", "modifier": "private", "original_string": "private long fragmentsNumber;", "type": "long", "var_name": "fragmentsNumber" }, { "declarator": "firstFragmentSize", "modifier": "private", "original_string": "private SizeAndUnit firstFragmentSize;", "type": "SizeAndUnit", "var_name": "firstFragmentSize" }, { "declarator": "totalSize", "modifier": "private", "original_string": "private SizeAndUnit totalSize;", "type": "SizeAndUnit", "var_name": "totalSize" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/FragmentStats.java", "identifier": "FragmentStats", "interfaces": "", "methods": [ { "class_method_signature": "FragmentStats.FragmentStats(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "constructor": true, "full_signature": "public FragmentStats(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "identifier": "FragmentStats", "modifiers": "public", "parameters": "(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "return": "", "signature": " FragmentStats(long fragmentsNumber, long firstFragmentSize,\n long totalSize)", "testcase": false }, { "class_method_signature": "FragmentStats.dataToJSON(FragmentStats stats)", "constructor": false, "full_signature": "public static String dataToJSON(FragmentStats stats)", "identifier": "dataToJSON", "modifiers": "public static", "parameters": "(FragmentStats stats)", "return": "String", "signature": "String dataToJSON(FragmentStats stats)", "testcase": false }, { "class_method_signature": "FragmentStats.dataToString(FragmentStats stats, String datapath)", "constructor": false, "full_signature": "public static String dataToString(FragmentStats stats, String datapath)", "identifier": "dataToString", "modifiers": "public static", "parameters": "(FragmentStats stats, String datapath)", "return": "String", "signature": "String dataToString(FragmentStats stats, String datapath)", "testcase": false }, { "class_method_signature": "FragmentStats.getFragmentsNumber()", "constructor": false, "full_signature": "public long getFragmentsNumber()", "identifier": "getFragmentsNumber", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getFragmentsNumber()", "testcase": false }, { "class_method_signature": "FragmentStats.setFragmentsNumber(long fragmentsNumber)", "constructor": false, "full_signature": "private void setFragmentsNumber(long fragmentsNumber)", "identifier": "setFragmentsNumber", "modifiers": "private", "parameters": "(long fragmentsNumber)", "return": "void", "signature": "void setFragmentsNumber(long fragmentsNumber)", "testcase": false }, { "class_method_signature": "FragmentStats.getFirstFragmentSize()", "constructor": false, "full_signature": "public SizeAndUnit getFirstFragmentSize()", "identifier": "getFirstFragmentSize", "modifiers": "public", "parameters": "()", "return": "SizeAndUnit", "signature": "SizeAndUnit getFirstFragmentSize()", "testcase": false }, { "class_method_signature": "FragmentStats.setFirstFragmentSize(long firstFragmentSize)", "constructor": false, "full_signature": "private void setFirstFragmentSize(long firstFragmentSize)", "identifier": "setFirstFragmentSize", "modifiers": "private", "parameters": "(long firstFragmentSize)", "return": "void", "signature": "void setFirstFragmentSize(long firstFragmentSize)", "testcase": false }, { "class_method_signature": "FragmentStats.getTotalSize()", "constructor": false, "full_signature": "public SizeAndUnit getTotalSize()", "identifier": "getTotalSize", "modifiers": "public", "parameters": "()", "return": "SizeAndUnit", "signature": "SizeAndUnit getTotalSize()", "testcase": false }, { "class_method_signature": "FragmentStats.setTotalSize(long totalSize)", "constructor": false, "full_signature": "private void setTotalSize(long totalSize)", "identifier": "setTotalSize", "modifiers": "private", "parameters": "(long totalSize)", "return": "void", "signature": "void setTotalSize(long totalSize)", "testcase": false }, { "class_method_signature": "FragmentStats.setSizeAndUnit(long originalSize)", "constructor": false, "full_signature": "private SizeAndUnit setSizeAndUnit(long originalSize)", "identifier": "setSizeAndUnit", "modifiers": "private", "parameters": "(long originalSize)", "return": "SizeAndUnit", "signature": "SizeAndUnit setSizeAndUnit(long originalSize)", "testcase": false }, { "class_method_signature": "FragmentStats.getSizeUnit(int orderOfMagnitude)", "constructor": false, "full_signature": "private SizeUnit getSizeUnit(int orderOfMagnitude)", "identifier": "getSizeUnit", "modifiers": "private", "parameters": "(int orderOfMagnitude)", "return": "SizeUnit", "signature": "SizeUnit getSizeUnit(int orderOfMagnitude)", "testcase": false } ], "superclass": "" }
{ "body": "public static String dataToJSON(FragmentStats stats) throws IOException {\n ObjectMapper mapper = new ObjectMapper();\n // mapper serializes all members of the class by default\n return \"{\\\"PXFFragmentsStats\\\":\" + mapper.writeValueAsString(stats)\n + \"}\";\n }", "class_method_signature": "FragmentStats.dataToJSON(FragmentStats stats)", "constructor": false, "full_signature": "public static String dataToJSON(FragmentStats stats)", "identifier": "dataToJSON", "invocations": [ "writeValueAsString" ], "modifiers": "public static", "parameters": "(FragmentStats stats)", "return": "String", "signature": "String dataToJSON(FragmentStats stats)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_371
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "dbProduct = null", "modifier": "private", "original_string": "private DbProduct dbProduct = null;", "type": "DbProduct", "var_name": "dbProduct" }, { "declarator": "COL_RAW = \"col\"", "modifier": "private final", "original_string": "private final String COL_RAW = \"col\";", "type": "String", "var_name": "COL_RAW" }, { "declarator": "QUOTE = \"\\\"\"", "modifier": "private final", "original_string": "private final String QUOTE = \"\\\"\";", "type": "String", "var_name": "QUOTE" }, { "declarator": "COL = QUOTE + COL_RAW + QUOTE", "modifier": "private final", "original_string": "private final String COL = QUOTE + COL_RAW + QUOTE;", "type": "String", "var_name": "COL" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/partitioning/IntPartitionTest.java", "identifier": "IntPartitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testLeftBounded() {\n IntPartition partition = new IntPartition(COL_RAW, 0L, null);\n String constraint = partition.toSqlConstraint(QUOTE, dbProduct);\n\n assertEquals(COL + \" >= 0\", constraint);\n }", "class_method_signature": "IntPartitionTest.testLeftBounded()", "constructor": false, "full_signature": "@Test public void testLeftBounded()", "identifier": "testLeftBounded", "invocations": [ "toSqlConstraint", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testLeftBounded()", "testcase": true }
{ "fields": [ { "declarator": "serialVersionUID = 0L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 0L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "boundaries", "modifier": "private final", "original_string": "private final Long[] boundaries;", "type": "Long[]", "var_name": "boundaries" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/partitioning/IntPartition.java", "identifier": "IntPartition", "interfaces": "implements JdbcFragmentMetadata", "methods": [ { "class_method_signature": "IntPartition.IntPartition(String column, Long start, Long end)", "constructor": true, "full_signature": "public IntPartition(String column, Long start, Long end)", "identifier": "IntPartition", "modifiers": "public", "parameters": "(String column, Long start, Long end)", "return": "", "signature": " IntPartition(String column, Long start, Long end)", "testcase": false }, { "class_method_signature": "IntPartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }, { "class_method_signature": "IntPartition.getBoundaries()", "constructor": false, "full_signature": "public Long[] getBoundaries()", "identifier": "getBoundaries", "modifiers": "public", "parameters": "()", "return": "Long[]", "signature": "Long[] getBoundaries()", "testcase": false } ], "superclass": "extends BasePartition" }
{ "body": "@Override\n public String toSqlConstraint(String quoteString, DbProduct dbProduct) {\n if (quoteString == null) {\n throw new RuntimeException(\"Quote string cannot be null\");\n }\n\n return generateRangeConstraint(\n quoteString + column + quoteString,\n Stream.of(boundaries).map(b -> b == null ? null : b.toString()).toArray(String[]::new)\n );\n }", "class_method_signature": "IntPartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "invocations": [ "generateRangeConstraint", "toArray", "map", "of", "toString" ], "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_234
{ "fields": [ { "declarator": "PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS)", "modifier": "private static final", "original_string": "private static final TreeVisitor PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS);", "type": "TreeVisitor", "var_name": "PRUNER" }, { "declarator": "TRAVERSER = new TreeTraverser()", "modifier": "private static final", "original_string": "private static final TreeTraverser TRAVERSER = new TreeTraverser();", "type": "TreeTraverser", "var_name": "TRAVERSER" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "tupleDescription", "modifier": "private", "original_string": "private HBaseTupleDescription tupleDescription;", "type": "HBaseTupleDescription", "var_name": "tupleDescription" }, { "declarator": "families = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n }", "modifier": "private", "original_string": "private byte[][] families = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n };", "type": "byte[][]", "var_name": "families" }, { "declarator": "qualifiers = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n }", "modifier": "private", "original_string": "private byte[][] qualifiers = new byte[][]{\n new byte[]{},\n new byte[]{},\n new byte[]{},\n new byte[]{},\n };", "type": "byte[][]", "var_name": "qualifiers" }, { "declarator": "columnCodes = {\n DataType.INTEGER.getOID(),\n DataType.TEXT.getOID(),\n DataType.REAL.getOID(),\n DataType.TEXT.getOID(),\n }", "modifier": "private", "original_string": "private int[] columnCodes = {\n DataType.INTEGER.getOID(),\n DataType.TEXT.getOID(),\n DataType.REAL.getOID(),\n DataType.TEXT.getOID(),\n };", "type": "int[]", "var_name": "columnCodes" } ], "file": "server/pxf-hbase/src/test/java/org/greenplum/pxf/plugins/hbase/HBaseFilterBuilderTest.java", "identifier": "HBaseFilterBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSimpleColumnOperator() throws Exception {\n // id > 5\n Filter filter = helper(\"a0c20s1d5o2\", tupleDescription);\n\n assertNotNull(filter);\n assertTrue(filter instanceof SingleColumnValueFilter);\n SingleColumnValueFilter scvFilter = (SingleColumnValueFilter) filter;\n assertSame(families[0], scvFilter.getFamily());\n assertSame(qualifiers[0], scvFilter.getQualifier());\n assertEquals(CompareFilter.CompareOp.GREATER, scvFilter.getOperator());\n assertTrue(scvFilter.getComparator() instanceof HBaseIntegerComparator);\n assertEquals(0, scvFilter.getComparator().compareTo(\"5\".getBytes()));\n }", "class_method_signature": "HBaseFilterBuilderTest.testSimpleColumnOperator()", "constructor": false, "full_signature": "@Test public void testSimpleColumnOperator()", "identifier": "testSimpleColumnOperator", "invocations": [ "helper", "assertNotNull", "assertTrue", "assertSame", "getFamily", "assertSame", "getQualifier", "assertEquals", "getOperator", "assertTrue", "getComparator", "assertEquals", "compareTo", "getComparator", "getBytes" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testSimpleColumnOperator()", "testcase": true }
{ "fields": [ { "declarator": "OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, CompareFilter.CompareOp>() {{\n put(Operator.LESS_THAN, CompareFilter.CompareOp.LESS); // \"<\"\n put(Operator.GREATER_THAN, CompareFilter.CompareOp.GREATER); // \">\"\n put(Operator.LESS_THAN_OR_EQUAL, CompareFilter.CompareOp.LESS_OR_EQUAL); // \"<=\"\n put(Operator.GREATER_THAN_OR_EQUAL, CompareFilter.CompareOp.GREATER_OR_EQUAL); // \">=\"\n put(Operator.EQUALS, CompareFilter.CompareOp.EQUAL); // \"=\"\n put(Operator.NOT_EQUALS, CompareFilter.CompareOp.NOT_EQUAL); // \"!=\"\n }})", "modifier": "private static final", "original_string": "private static final Map<Operator, CompareFilter.CompareOp> OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, CompareFilter.CompareOp>() {{\n put(Operator.LESS_THAN, CompareFilter.CompareOp.LESS); // \"<\"\n put(Operator.GREATER_THAN, CompareFilter.CompareOp.GREATER); // \">\"\n put(Operator.LESS_THAN_OR_EQUAL, CompareFilter.CompareOp.LESS_OR_EQUAL); // \"<=\"\n put(Operator.GREATER_THAN_OR_EQUAL, CompareFilter.CompareOp.GREATER_OR_EQUAL); // \">=\"\n put(Operator.EQUALS, CompareFilter.CompareOp.EQUAL); // \"=\"\n put(Operator.NOT_EQUALS, CompareFilter.CompareOp.NOT_EQUAL); // \"!=\"\n }});", "type": "Map<Operator, CompareFilter.CompareOp>", "var_name": "OPERATORS_MAP" }, { "declarator": "LOGICAL_OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, FilterList.Operator>() {{\n put(Operator.AND, FilterList.Operator.MUST_PASS_ALL);\n put(Operator.OR, FilterList.Operator.MUST_PASS_ONE);\n }})", "modifier": "private static final", "original_string": "private static final Map<Operator, FilterList.Operator> LOGICAL_OPERATORS_MAP =\n Collections.unmodifiableMap(new HashMap<Operator, FilterList.Operator>() {{\n put(Operator.AND, FilterList.Operator.MUST_PASS_ALL);\n put(Operator.OR, FilterList.Operator.MUST_PASS_ONE);\n }});", "type": "Map<Operator, FilterList.Operator>", "var_name": "LOGICAL_OPERATORS_MAP" }, { "declarator": "endKeyAssigned = false", "modifier": "private", "original_string": "private boolean endKeyAssigned = false;", "type": "boolean", "var_name": "endKeyAssigned" }, { "declarator": "startKeyAssigned = false", "modifier": "private", "original_string": "private boolean startKeyAssigned = false;", "type": "boolean", "var_name": "startKeyAssigned" }, { "declarator": "endKey", "modifier": "private", "original_string": "private byte[] endKey;", "type": "byte[]", "var_name": "endKey" }, { "declarator": "startKey", "modifier": "private", "original_string": "private byte[] startKey;", "type": "byte[]", "var_name": "startKey" }, { "declarator": "filterQueue", "modifier": "private", "original_string": "private Deque<Filter> filterQueue;", "type": "Deque<Filter>", "var_name": "filterQueue" }, { "declarator": "currentFilter", "modifier": "private", "original_string": "private Filter currentFilter;", "type": "Filter", "var_name": "currentFilter" }, { "declarator": "tupleDescription", "modifier": "private", "original_string": "private HBaseTupleDescription tupleDescription;", "type": "HBaseTupleDescription", "var_name": "tupleDescription" } ], "file": "server/pxf-hbase/src/main/java/org/greenplum/pxf/plugins/hbase/HBaseFilterBuilder.java", "identifier": "HBaseFilterBuilder", "interfaces": "implements TreeVisitor", "methods": [ { "class_method_signature": "HBaseFilterBuilder.HBaseFilterBuilder(HBaseTupleDescription tupleDescription)", "constructor": true, "full_signature": "public HBaseFilterBuilder(HBaseTupleDescription tupleDescription)", "identifier": "HBaseFilterBuilder", "modifiers": "public", "parameters": "(HBaseTupleDescription tupleDescription)", "return": "", "signature": " HBaseFilterBuilder(HBaseTupleDescription tupleDescription)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.before(Node node, final int level)", "constructor": false, "full_signature": "@Override public Node before(Node node, final int level)", "identifier": "before", "modifiers": "@Override public", "parameters": "(Node node, final int level)", "return": "Node", "signature": "Node before(Node node, final int level)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.visit(Node node, final int level)", "constructor": false, "full_signature": "@Override public Node visit(Node node, final int level)", "identifier": "visit", "modifiers": "@Override public", "parameters": "(Node node, final int level)", "return": "Node", "signature": "Node visit(Node node, final int level)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.after(Node node, final int level)", "constructor": false, "full_signature": "@Override public Node after(Node node, final int level)", "identifier": "after", "modifiers": "@Override public", "parameters": "(Node node, final int level)", "return": "Node", "signature": "Node after(Node node, final int level)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.build()", "constructor": false, "full_signature": "public Filter build()", "identifier": "build", "modifiers": "public", "parameters": "()", "return": "Filter", "signature": "Filter build()", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.getStartKey()", "constructor": false, "full_signature": "public byte[] getStartKey()", "identifier": "getStartKey", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getStartKey()", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.getEndKey()", "constructor": false, "full_signature": "public byte[] getEndKey()", "identifier": "getEndKey", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getEndKey()", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.processFilter(Filter filter)", "constructor": false, "full_signature": "private void processFilter(Filter filter)", "identifier": "processFilter", "modifiers": "private", "parameters": "(Filter filter)", "return": "void", "signature": "void processFilter(Filter filter)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.processSimpleColumnOperator(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "constructor": false, "full_signature": "private Filter processSimpleColumnOperator(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "identifier": "processSimpleColumnOperator", "modifiers": "private", "parameters": "(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "return": "Filter", "signature": "Filter processSimpleColumnOperator(HBaseColumnDescriptor hBaseColumn,\n Operator operator,\n OperandNode data)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.processNullOperator(HBaseColumnDescriptor hBaseColumn, Operator operator)", "constructor": false, "full_signature": "private Filter processNullOperator(HBaseColumnDescriptor hBaseColumn, Operator operator)", "identifier": "processNullOperator", "modifiers": "private", "parameters": "(HBaseColumnDescriptor hBaseColumn, Operator operator)", "return": "Filter", "signature": "Filter processNullOperator(HBaseColumnDescriptor hBaseColumn, Operator operator)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.isTextualRowKey(HBaseColumnDescriptor column)", "constructor": false, "full_signature": "private boolean isTextualRowKey(HBaseColumnDescriptor column)", "identifier": "isTextualRowKey", "modifiers": "private", "parameters": "(HBaseColumnDescriptor column)", "return": "boolean", "signature": "boolean isTextualRowKey(HBaseColumnDescriptor column)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.getComparator(int type, OperandNode data)", "constructor": false, "full_signature": "private ByteArrayComparable getComparator(int type, OperandNode data)", "identifier": "getComparator", "modifiers": "private", "parameters": "(int type, OperandNode data)", "return": "ByteArrayComparable", "signature": "ByteArrayComparable getComparator(int type, OperandNode data)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.storeStartEndKeys(Operator op, String data)", "constructor": false, "full_signature": "private void storeStartEndKeys(Operator op, String data)", "identifier": "storeStartEndKeys", "modifiers": "private", "parameters": "(Operator op, String data)", "return": "void", "signature": "void storeStartEndKeys(Operator op, String data)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.setStartKey(byte[] startKey)", "constructor": false, "full_signature": "private void setStartKey(byte[] startKey)", "identifier": "setStartKey", "modifiers": "private", "parameters": "(byte[] startKey)", "return": "void", "signature": "void setStartKey(byte[] startKey)", "testcase": false }, { "class_method_signature": "HBaseFilterBuilder.setEndKey(byte[] endKey)", "constructor": false, "full_signature": "private void setEndKey(byte[] endKey)", "identifier": "setEndKey", "modifiers": "private", "parameters": "(byte[] endKey)", "return": "void", "signature": "void setEndKey(byte[] endKey)", "testcase": false } ], "superclass": "" }
{ "body": "private ByteArrayComparable getComparator(int type, OperandNode data) {\n ByteArrayComparable result;\n switch (DataType.get(type)) {\n case TEXT:\n result = new BinaryComparator(Bytes.toBytes(data.toString()));\n break;\n case SMALLINT:\n case INTEGER:\n result = new HBaseIntegerComparator(Long.parseLong(data.toString()));\n break;\n case BIGINT:\n case REAL:\n\n // Check the operand's original data type\n switch (data.getDataType()) {\n case BIGINT:\n case INTEGER:\n case SMALLINT:\n result = new HBaseIntegerComparator(Long.parseLong(data.toString()));\n break;\n case REAL:\n result = new HBaseFloatComparator(Float.parseFloat(data.toString()));\n break;\n case NUMERIC:\n case FLOAT8:\n result = new HBaseDoubleComparator(Double.parseDouble(data.toString()));\n break;\n default:\n result = null;\n break;\n }\n break;\n\n case FLOAT8:\n result = new HBaseDoubleComparator(Double.parseDouble(data.toString()));\n break;\n default:\n throw new IllegalArgumentException(String.format(\"unsupported column type for filtering %d\", type));\n }\n\n return result;\n }", "class_method_signature": "HBaseFilterBuilder.getComparator(int type, OperandNode data)", "constructor": false, "full_signature": "private ByteArrayComparable getComparator(int type, OperandNode data)", "identifier": "getComparator", "invocations": [ "get", "toBytes", "toString", "parseLong", "toString", "getDataType", "parseLong", "toString", "parseFloat", "toString", "parseDouble", "toString", "parseDouble", "toString", "format" ], "modifiers": "private", "parameters": "(int type, OperandNode data)", "return": "ByteArrayComparable", "signature": "ByteArrayComparable getComparator(int type, OperandNode data)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_41
{ "fields": [], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/filter/CollectionOperandNodeTest.java", "identifier": "CollectionOperandNodeTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetData() {\n List<String> data = new ArrayList<>();\n data.add(\"s\");\n CollectionOperandNode operand = new CollectionOperandNode(DataType.INTEGER, data);\n\n assertSame(data, operand.getData());\n assertEquals(\"s\", operand.getData().get(0));\n }", "class_method_signature": "CollectionOperandNodeTest.testGetData()", "constructor": false, "full_signature": "@Test public void testGetData()", "identifier": "testGetData", "invocations": [ "add", "assertSame", "getData", "assertEquals", "get", "getData" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGetData()", "testcase": true }
{ "fields": [ { "declarator": "data", "modifier": "private final", "original_string": "private final List<String> data;", "type": "List<String>", "var_name": "data" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/filter/CollectionOperandNode.java", "identifier": "CollectionOperandNode", "interfaces": "", "methods": [ { "class_method_signature": "CollectionOperandNode.CollectionOperandNode(DataType dataType, List<String> data)", "constructor": true, "full_signature": "public CollectionOperandNode(DataType dataType, List<String> data)", "identifier": "CollectionOperandNode", "modifiers": "public", "parameters": "(DataType dataType, List<String> data)", "return": "", "signature": " CollectionOperandNode(DataType dataType, List<String> data)", "testcase": false }, { "class_method_signature": "CollectionOperandNode.getData()", "constructor": false, "full_signature": "public List<String> getData()", "identifier": "getData", "modifiers": "public", "parameters": "()", "return": "List<String>", "signature": "List<String> getData()", "testcase": false }, { "class_method_signature": "CollectionOperandNode.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toString()", "testcase": false } ], "superclass": "extends OperandNode" }
{ "body": "public List<String> getData() {\n return data;\n }", "class_method_signature": "CollectionOperandNode.getData()", "constructor": false, "full_signature": "public List<String> getData()", "identifier": "getData", "invocations": [], "modifiers": "public", "parameters": "()", "return": "List<String>", "signature": "List<String> getData()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_408
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3SelectAccessorTest.java", "identifier": "S3SelectAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testQuoteCharacter() {\n RequestContext context = getDefaultRequestContext();\n context.addOption(\"QUOTE\", \"\\\"\");\n InputSerialization inputSerialization =\n new S3SelectAccessor().getInputSerialization(context);\n assertEquals('\"', inputSerialization.getCsv().getQuoteCharacter().charValue());\n }", "class_method_signature": "S3SelectAccessorTest.testQuoteCharacter()", "constructor": false, "full_signature": "@Test public void testQuoteCharacter()", "identifier": "testQuoteCharacter", "invocations": [ "getDefaultRequestContext", "addOption", "getInputSerialization", "assertEquals", "charValue", "getQuoteCharacter", "getCsv" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testQuoteCharacter()", "testcase": true }
{ "fields": [ { "declarator": "COMPRESSION_TYPE = \"COMPRESSION_CODEC\"", "modifier": "public static final", "original_string": "public static final String COMPRESSION_TYPE = \"COMPRESSION_CODEC\";", "type": "String", "var_name": "COMPRESSION_TYPE" }, { "declarator": "FILE_HEADER_INFO = \"FILE_HEADER\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO = \"FILE_HEADER\";", "type": "String", "var_name": "FILE_HEADER_INFO" }, { "declarator": "FILE_HEADER_INFO_NONE = \"NONE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_NONE = \"NONE\";", "type": "String", "var_name": "FILE_HEADER_INFO_NONE" }, { "declarator": "FILE_HEADER_INFO_IGNORE = \"IGNORE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_IGNORE = \"IGNORE\";", "type": "String", "var_name": "FILE_HEADER_INFO_IGNORE" }, { "declarator": "FILE_HEADER_INFO_USE = \"USE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_USE = \"USE\";", "type": "String", "var_name": "FILE_HEADER_INFO_USE" }, { "declarator": "JSON_TYPE = \"JSON-TYPE\"", "modifier": "public static final", "original_string": "public static final String JSON_TYPE = \"JSON-TYPE\";", "type": "String", "var_name": "JSON_TYPE" }, { "declarator": "isResultComplete", "modifier": "private", "original_string": "private AtomicBoolean isResultComplete;", "type": "AtomicBoolean", "var_name": "isResultComplete" }, { "declarator": "s3Client", "modifier": "private", "original_string": "private AmazonS3 s3Client;", "type": "AmazonS3", "var_name": "s3Client" }, { "declarator": "result", "modifier": "private", "original_string": "private SelectObjectContentResult result;", "type": "SelectObjectContentResult", "var_name": "result" }, { "declarator": "resultInputStream", "modifier": "private", "original_string": "private InputStream resultInputStream;", "type": "InputStream", "var_name": "resultInputStream" }, { "declarator": "reader", "modifier": "private", "original_string": "private BufferedReader reader;", "type": "BufferedReader", "var_name": "reader" }, { "declarator": "lineReadCount", "modifier": "private", "original_string": "private int lineReadCount;", "type": "int", "var_name": "lineReadCount" }, { "declarator": "name", "modifier": "private", "original_string": "private URI name;", "type": "URI", "var_name": "name" } ], "file": "server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3SelectAccessor.java", "identifier": "S3SelectAccessor", "interfaces": "implements Accessor", "methods": [ { "class_method_signature": "S3SelectAccessor.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForRead()", "constructor": false, "full_signature": "@Override public boolean openForRead()", "identifier": "openForRead", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.readNextObject()", "constructor": false, "full_signature": "@Override public OneRow readNextObject()", "identifier": "readNextObject", "modifiers": "@Override public", "parameters": "()", "return": "OneRow", "signature": "OneRow readNextObject()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForRead()", "constructor": false, "full_signature": "@Override public void closeForRead()", "identifier": "closeForRead", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.generateBaseCSVRequest(RequestContext context)", "constructor": false, "full_signature": " SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "identifier": "generateBaseCSVRequest", "modifiers": "", "parameters": "(RequestContext context)", "return": "SelectObjectContentRequest", "signature": "SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getOutputSerialization(RequestContext context)", "constructor": false, "full_signature": "private OutputSerialization getOutputSerialization(RequestContext context)", "identifier": "getOutputSerialization", "modifiers": "private", "parameters": "(RequestContext context)", "return": "OutputSerialization", "signature": "OutputSerialization getOutputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getInputSerialization(RequestContext context)", "constructor": false, "full_signature": " InputSerialization getInputSerialization(RequestContext context)", "identifier": "getInputSerialization", "modifiers": "", "parameters": "(RequestContext context)", "return": "InputSerialization", "signature": "InputSerialization getInputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getJSONInput(RequestContext context)", "constructor": false, "full_signature": " JSONInput getJSONInput(RequestContext context)", "identifier": "getJSONInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "JSONInput", "signature": "JSONInput getJSONInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getCSVInput(RequestContext context)", "constructor": false, "full_signature": " CSVInput getCSVInput(RequestContext context)", "identifier": "getCSVInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "CSVInput", "signature": "CSVInput getCSVInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.initS3Client()", "constructor": false, "full_signature": "private AmazonS3 initS3Client()", "identifier": "initS3Client", "modifiers": "private", "parameters": "()", "return": "AmazonS3", "signature": "AmazonS3 initS3Client()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForWrite()", "constructor": false, "full_signature": "@Override public boolean openForWrite()", "identifier": "openForWrite", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForWrite()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.writeNextObject(OneRow onerow)", "constructor": false, "full_signature": "@Override public boolean writeNextObject(OneRow onerow)", "identifier": "writeNextObject", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "boolean", "signature": "boolean writeNextObject(OneRow onerow)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "InputSerialization getInputSerialization(RequestContext context) {\n InputSerialization inputSerialization = new InputSerialization();\n\n // We need to infer the format name from the profile (i.e. s3:parquet\n // would return parquet for the format)\n String format = context.inferFormatName();\n String compressionType = context.getOption(COMPRESSION_TYPE);\n\n LOG.debug(\"With format {}\", format);\n if (StringUtils.equalsIgnoreCase(format, \"parquet\")) {\n inputSerialization.setParquet(new ParquetInput());\n } else if (StringUtils.equalsIgnoreCase(format, \"json\")) {\n inputSerialization.setJson(getJSONInput(context));\n } else {\n inputSerialization.setCsv(getCSVInput(context));\n }\n\n LOG.debug(\"With compression type {}\", compressionType);\n if (StringUtils.equalsIgnoreCase(compressionType, \"gzip\")) {\n inputSerialization.setCompressionType(CompressionType.GZIP);\n } else if (StringUtils.equalsIgnoreCase(compressionType, \"bzip2\")) {\n inputSerialization.setCompressionType(CompressionType.BZIP2);\n } else {\n inputSerialization.setCompressionType(CompressionType.NONE);\n }\n\n return inputSerialization;\n }", "class_method_signature": "S3SelectAccessor.getInputSerialization(RequestContext context)", "constructor": false, "full_signature": " InputSerialization getInputSerialization(RequestContext context)", "identifier": "getInputSerialization", "invocations": [ "inferFormatName", "getOption", "debug", "equalsIgnoreCase", "setParquet", "equalsIgnoreCase", "setJson", "getJSONInput", "setCsv", "getCSVInput", "debug", "equalsIgnoreCase", "setCompressionType", "equalsIgnoreCase", "setCompressionType", "setCompressionType" ], "modifiers": "", "parameters": "(RequestContext context)", "return": "InputSerialization", "signature": "InputSerialization getInputSerialization(RequestContext context)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_367
{ "fields": [ { "declarator": "connConfig", "modifier": "private", "original_string": "private Properties connConfig, poolConfig;", "type": "Properties", "var_name": "connConfig" }, { "declarator": "poolDescriptor", "modifier": "private", "original_string": "private PoolDescriptor poolDescriptor;", "type": "PoolDescriptor", "var_name": "poolDescriptor" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/utils/PoolDescriptorTest.java", "identifier": "PoolDescriptorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPoolDescriptorHashCodeAndEquals() {\n poolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", connConfig, poolConfig, \"foo\");\n\n Properties sameConnConfig = (Properties) connConfig.clone();\n Properties samePoolConfig = (Properties) poolConfig.clone();\n PoolDescriptor samePoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", sameConnConfig, samePoolConfig, \"foo\");\n\n assertEquals(poolDescriptor.hashCode(), samePoolDescriptor.hashCode());\n assertEquals(poolDescriptor, samePoolDescriptor);\n\n // test different configs\n PoolDescriptor diffPoolDescriptor = new PoolDescriptor(\"diff-server\", \"test-jdbcUrl\", sameConnConfig, samePoolConfig, \"foo\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"diff-jdbcUrl\", sameConnConfig, samePoolConfig, \"foo\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n\n Properties diffConnConfig = (Properties) connConfig.clone();\n diffConnConfig.setProperty(\"user\", \"foo\");\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", diffConnConfig, samePoolConfig, \"foo\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n diffConnConfig = (Properties) connConfig.clone();\n diffConnConfig.setProperty(\"password\", \"bar\");\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", diffConnConfig, samePoolConfig, \"foo\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n diffConnConfig = (Properties) connConfig.clone();\n diffConnConfig.setProperty(\"foo\", \"bar\");\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", diffConnConfig, samePoolConfig, \"foo\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n Properties diffPoolConfig = (Properties) poolConfig.clone();\n diffPoolConfig.setProperty(\"abc\", \"xyz\");\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", sameConnConfig, diffPoolConfig, \"foo\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", sameConnConfig, samePoolConfig, \"bar\");\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", sameConnConfig, samePoolConfig, null);\n assertNotEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertNotEquals(poolDescriptor, diffPoolDescriptor);\n\n poolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", connConfig, poolConfig, null);\n diffPoolDescriptor = new PoolDescriptor(\"test-server\", \"test-jdbcUrl\", sameConnConfig, samePoolConfig, null);\n assertEquals(poolDescriptor.hashCode(), diffPoolDescriptor.hashCode());\n assertEquals(poolDescriptor, diffPoolDescriptor);\n }", "class_method_signature": "PoolDescriptorTest.testPoolDescriptorHashCodeAndEquals()", "constructor": false, "full_signature": "@Test public void testPoolDescriptorHashCodeAndEquals()", "identifier": "testPoolDescriptorHashCodeAndEquals", "invocations": [ "clone", "clone", "assertEquals", "hashCode", "hashCode", "assertEquals", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "clone", "setProperty", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "clone", "setProperty", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "clone", "setProperty", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "clone", "setProperty", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "assertNotEquals", "hashCode", "hashCode", "assertNotEquals", "assertEquals", "hashCode", "hashCode", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testPoolDescriptorHashCodeAndEquals()", "testcase": true }
{ "fields": [ { "declarator": "USER_PROPERTY_NAME = \"user\"", "modifier": "private static final", "original_string": "private static final String USER_PROPERTY_NAME = \"user\";", "type": "String", "var_name": "USER_PROPERTY_NAME" }, { "declarator": "PASSWORD_PROPERTY_NAME = \"password\"", "modifier": "private static final", "original_string": "private static final String PASSWORD_PROPERTY_NAME = \"password\";", "type": "String", "var_name": "PASSWORD_PROPERTY_NAME" }, { "declarator": "PROHIBITED_PROPERTIES =\n Sets.newHashSet(\"username\", \"password\", \"dataSource.user\", \"dataSource.password\", \"dataSourceClassName\", \"jdbcUrl\")", "modifier": "private static final", "original_string": "private static final Set<String> PROHIBITED_PROPERTIES =\n Sets.newHashSet(\"username\", \"password\", \"dataSource.user\", \"dataSource.password\", \"dataSourceClassName\", \"jdbcUrl\");", "type": "Set<String>", "var_name": "PROHIBITED_PROPERTIES" }, { "declarator": "server", "modifier": "private", "original_string": "private String server;", "type": "String", "var_name": "server" }, { "declarator": "jdbcUrl", "modifier": "private", "original_string": "private String jdbcUrl;", "type": "String", "var_name": "jdbcUrl" }, { "declarator": "user", "modifier": "private", "original_string": "private String user;", "type": "String", "var_name": "user" }, { "declarator": "password", "modifier": "private", "original_string": "private String password;", "type": "String", "var_name": "password" }, { "declarator": "connectionConfig", "modifier": "private", "original_string": "private Properties connectionConfig, poolConfig;", "type": "Properties", "var_name": "connectionConfig" }, { "declarator": "qualifier", "modifier": "private", "original_string": "private String qualifier;", "type": "String", "var_name": "qualifier" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/utils/PoolDescriptor.java", "identifier": "PoolDescriptor", "interfaces": "", "methods": [ { "class_method_signature": "PoolDescriptor.PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "constructor": true, "full_signature": "public PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "identifier": "PoolDescriptor", "modifiers": "public", "parameters": "(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "return": "", "signature": " PoolDescriptor(String server, String jdbcUrl, Properties connectionConfig, Properties poolConfig, String qualifier)", "testcase": false }, { "class_method_signature": "PoolDescriptor.getServer()", "constructor": false, "full_signature": "public String getServer()", "identifier": "getServer", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getServer()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getJdbcUrl()", "constructor": false, "full_signature": "public String getJdbcUrl()", "identifier": "getJdbcUrl", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getJdbcUrl()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getUser()", "constructor": false, "full_signature": "public String getUser()", "identifier": "getUser", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getUser()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getPassword()", "constructor": false, "full_signature": "public String getPassword()", "identifier": "getPassword", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getPassword()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getConnectionConfig()", "constructor": false, "full_signature": "public Properties getConnectionConfig()", "identifier": "getConnectionConfig", "modifiers": "public", "parameters": "()", "return": "Properties", "signature": "Properties getConnectionConfig()", "testcase": false }, { "class_method_signature": "PoolDescriptor.getPoolConfig()", "constructor": false, "full_signature": "public Properties getPoolConfig()", "identifier": "getPoolConfig", "modifiers": "public", "parameters": "()", "return": "Properties", "signature": "Properties getPoolConfig()", "testcase": false }, { "class_method_signature": "PoolDescriptor.equals(Object o)", "constructor": false, "full_signature": "@Override public boolean equals(Object o)", "identifier": "equals", "modifiers": "@Override public", "parameters": "(Object o)", "return": "boolean", "signature": "boolean equals(Object o)", "testcase": false }, { "class_method_signature": "PoolDescriptor.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "modifiers": "@Override public", "parameters": "()", "return": "int", "signature": "int hashCode()", "testcase": false }, { "class_method_signature": "PoolDescriptor.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toString()", "testcase": false }, { "class_method_signature": "PoolDescriptor.ensurePoolPropertyNotPresent(String propName)", "constructor": false, "full_signature": "private void ensurePoolPropertyNotPresent(String propName)", "identifier": "ensurePoolPropertyNotPresent", "modifiers": "private", "parameters": "(String propName)", "return": "void", "signature": "void ensurePoolPropertyNotPresent(String propName)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public int hashCode() {\n return Objects.hash(server, jdbcUrl, user, password, connectionConfig, poolConfig, qualifier);\n }", "class_method_signature": "PoolDescriptor.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "invocations": [ "hash" ], "modifiers": "@Override public", "parameters": "()", "return": "int", "signature": "int hashCode()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_388
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "dbProduct = DbProduct.POSTGRES", "modifier": "private", "original_string": "private DbProduct dbProduct = DbProduct.POSTGRES;", "type": "DbProduct", "var_name": "dbProduct" }, { "declarator": "COL_RAW = \"col\"", "modifier": "private final", "original_string": "private final String COL_RAW = \"col\";", "type": "String", "var_name": "COL_RAW" }, { "declarator": "QUOTE = \"\\\"\"", "modifier": "private final", "original_string": "private final String QUOTE = \"\\\"\";", "type": "String", "var_name": "QUOTE" }, { "declarator": "COL = QUOTE + COL_RAW + QUOTE", "modifier": "private final", "original_string": "private final String COL = QUOTE + COL_RAW + QUOTE;", "type": "String", "var_name": "COL" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/partitioning/DatePartitionTest.java", "identifier": "DatePartitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testInvalidNullDbProduct() {\n DatePartition partition = new DatePartition(COL_RAW, LocalDate.parse(\"2000-01-01\"), LocalDate.parse(\"2000-01-02\"));\n\n thrown.expect(RuntimeException.class);\n\n partition.toSqlConstraint(COL, null);\n }", "class_method_signature": "DatePartitionTest.testInvalidNullDbProduct()", "constructor": false, "full_signature": "@Test public void testInvalidNullDbProduct()", "identifier": "testInvalidNullDbProduct", "invocations": [ "parse", "parse", "expect", "toSqlConstraint" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testInvalidNullDbProduct()", "testcase": true }
{ "fields": [ { "declarator": "serialVersionUID = 0L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 0L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "boundaries", "modifier": "private final", "original_string": "private final Date[] boundaries;", "type": "Date[]", "var_name": "boundaries" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/partitioning/DatePartition.java", "identifier": "DatePartition", "interfaces": "implements JdbcFragmentMetadata", "methods": [ { "class_method_signature": "DatePartition.DatePartition(String column, LocalDate start, LocalDate end)", "constructor": true, "full_signature": "public DatePartition(String column, LocalDate start, LocalDate end)", "identifier": "DatePartition", "modifiers": "public", "parameters": "(String column, LocalDate start, LocalDate end)", "return": "", "signature": " DatePartition(String column, LocalDate start, LocalDate end)", "testcase": false }, { "class_method_signature": "DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }, { "class_method_signature": "DatePartition.getBoundaries()", "constructor": false, "full_signature": "public Date[] getBoundaries()", "identifier": "getBoundaries", "modifiers": "public", "parameters": "()", "return": "Date[]", "signature": "Date[] getBoundaries()", "testcase": false } ], "superclass": "extends BasePartition" }
{ "body": "@Override\n public String toSqlConstraint(String quoteString, DbProduct dbProduct) {\n if (quoteString == null) {\n throw new RuntimeException(\"Quote string cannot be null\");\n }\n if (dbProduct == null) {\n throw new RuntimeException(String.format(\n \"DbProduct cannot be null for partitions of type '%s'\", PartitionType.DATE\n ));\n }\n\n return generateRangeConstraint(\n quoteString + column + quoteString,\n Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new)\n );\n }", "class_method_signature": "DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "invocations": [ "format", "generateRangeConstraint", "toArray", "map", "of", "wrapDate" ], "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_222
{ "fields": [ { "declarator": "parameters", "modifier": "private", "original_string": "private MultivaluedMap<String, String> parameters;", "type": "MultivaluedMap<String, String>", "var_name": "parameters" }, { "declarator": "parser", "modifier": "private", "original_string": "private HttpRequestParser parser;", "type": "HttpRequestParser", "var_name": "parser" }, { "declarator": "mockRequestHeaders", "modifier": "@Mock\n private", "original_string": "@Mock\n private ContainerRequest mockRequestHeaders;", "type": "ContainerRequest", "var_name": "mockRequestHeaders" }, { "declarator": "mockPluginConf", "modifier": "@Mock\n private", "original_string": "@Mock\n private PluginConf mockPluginConf;", "type": "PluginConf", "var_name": "mockPluginConf" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/HttpRequestParserTest.java", "identifier": "HttpRequestParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testHandlerIsNotCalledWhenNotDefined() {\n when(mockPluginConf.getHandler(\"test-profile\")).thenReturn(null);\n parameters.putSingle(\"X-GP-OPTIONS-PROFILE\", \"test-profile\");\n RequestContext context = parser.parseRequest(mockRequestHeaders, RequestType.FRAGMENTER);\n assertEquals(\"are\", context.getAccessor());\n assertEquals(\"packed\", context.getResolver());\n }", "class_method_signature": "HttpRequestParserTest.testHandlerIsNotCalledWhenNotDefined()", "constructor": false, "full_signature": "@Test public void testHandlerIsNotCalledWhenNotDefined()", "identifier": "testHandlerIsNotCalledWhenNotDefined", "invocations": [ "thenReturn", "when", "getHandler", "putSingle", "parseRequest", "assertEquals", "getAccessor", "assertEquals", "getResolver" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testHandlerIsNotCalledWhenNotDefined()", "testcase": true }
{ "fields": [ { "declarator": "TRUE_LCASE = \"true\"", "modifier": "private static final", "original_string": "private static final String TRUE_LCASE = \"true\";", "type": "String", "var_name": "TRUE_LCASE" }, { "declarator": "FALSE_LCASE = \"false\"", "modifier": "private static final", "original_string": "private static final String FALSE_LCASE = \"false\";", "type": "String", "var_name": "FALSE_LCASE" }, { "declarator": "LOG = LoggerFactory.getLogger(HttpRequestParser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpRequestParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "instance = new HttpRequestParser()", "modifier": "private static final", "original_string": "private static final HttpRequestParser instance = new HttpRequestParser();", "type": "HttpRequestParser", "var_name": "instance" }, { "declarator": "PROFILE_SCHEME = \"PROFILE-SCHEME\"", "modifier": "private static final", "original_string": "private static final String PROFILE_SCHEME = \"PROFILE-SCHEME\";", "type": "String", "var_name": "PROFILE_SCHEME" }, { "declarator": "pluginConf", "modifier": "private", "original_string": "private PluginConf pluginConf;", "type": "PluginConf", "var_name": "pluginConf" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/HttpRequestParser.java", "identifier": "HttpRequestParser", "interfaces": "implements RequestParser<HttpHeaders>", "methods": [ { "class_method_signature": "HttpRequestParser.HttpRequestParser()", "constructor": true, "full_signature": "public HttpRequestParser()", "identifier": "HttpRequestParser", "modifiers": "public", "parameters": "()", "return": "", "signature": " HttpRequestParser()", "testcase": false }, { "class_method_signature": "HttpRequestParser.HttpRequestParser(PluginConf pluginConf)", "constructor": true, "full_signature": " HttpRequestParser(PluginConf pluginConf)", "identifier": "HttpRequestParser", "modifiers": "", "parameters": "(PluginConf pluginConf)", "return": "", "signature": " HttpRequestParser(PluginConf pluginConf)", "testcase": false }, { "class_method_signature": "HttpRequestParser.getInstance()", "constructor": false, "full_signature": "public static HttpRequestParser getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "HttpRequestParser", "signature": "HttpRequestParser getInstance()", "testcase": false }, { "class_method_signature": "HttpRequestParser.protocolViolation(String property)", "constructor": false, "full_signature": "private static void protocolViolation(String property)", "identifier": "protocolViolation", "modifiers": "private static", "parameters": "(String property)", "return": "void", "signature": "void protocolViolation(String property)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseGreenplumCSV(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseGreenplumCSV(RequestMap params, RequestContext context)", "identifier": "parseGreenplumCSV", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseGreenplumCSV(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.addProfilePlugins(String profile, RequestMap params)", "constructor": false, "full_signature": "private void addProfilePlugins(String profile, RequestMap params)", "identifier": "addProfilePlugins", "modifiers": "private", "parameters": "(String profile, RequestMap params)", "return": "void", "signature": "void addProfilePlugins(String profile, RequestMap params)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseBooleanValue(String threadSafeStr)", "constructor": false, "full_signature": "private boolean parseBooleanValue(String threadSafeStr)", "identifier": "parseBooleanValue", "modifiers": "private", "parameters": "(String threadSafeStr)", "return": "boolean", "signature": "boolean parseBooleanValue(String threadSafeStr)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTupleDescription(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseTupleDescription(RequestMap params, RequestContext context)", "identifier": "parseTupleDescription", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseTupleDescription(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTypeMods(RequestMap params, int columnIndex)", "constructor": false, "full_signature": "private Integer[] parseTypeMods(RequestMap params, int columnIndex)", "identifier": "parseTypeMods", "modifiers": "private", "parameters": "(RequestMap params, int columnIndex)", "return": "Integer[]", "signature": "Integer[] parseTypeMods(RequestMap params, int columnIndex)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parsePositiveIntOrError(String s, String propName)", "constructor": false, "full_signature": "private int parsePositiveIntOrError(String s, String propName)", "identifier": "parsePositiveIntOrError", "modifiers": "private", "parameters": "(String s, String propName)", "return": "int", "signature": "int parsePositiveIntOrError(String s, String propName)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType) {\n\n RequestMap params = new RequestMap(request.getRequestHeaders());\n\n if (LOG.isDebugEnabled()) {\n // Logging only keys to prevent sensitive data to be logged\n LOG.debug(\"Parsing request parameters: \" + params.keySet());\n }\n\n // build new instance of RequestContext and fill it with parsed values\n RequestContext context = new RequestContext();\n\n // whether we are in a fragmenter, read_bridge, or write_bridge scenario\n context.setRequestType(requestType);\n\n // first of all, set profile and enrich parameters with information from specified profile\n String profile = params.removeUserProperty(\"PROFILE\");\n context.setProfile(profile);\n addProfilePlugins(profile, params);\n\n // Ext table uses system property FORMAT for wire serialization format\n String wireFormat = params.removeProperty(\"FORMAT\");\n context.setOutputFormat(OutputFormat.valueOf(wireFormat));\n\n // FDW uses user property FORMAT to indicate format of data\n String format = params.removeUserProperty(\"FORMAT\");\n format = StringUtils.isNotBlank(format) ? format : context.inferFormatName();\n context.setFormat(format);\n\n context.setAccessor(params.removeUserProperty(\"ACCESSOR\"));\n context.setAggType(EnumAggregationType.getAggregationType(params.removeOptionalProperty(\"AGG-TYPE\")));\n\n /*\n * Some resources don't require a fragment, hence the list can be empty.\n */\n String fragmentStr = params.removeOptionalProperty(\"DATA-FRAGMENT\");\n if (StringUtils.isNotBlank(fragmentStr)) {\n context.setDataFragment(Integer.parseInt(fragmentStr));\n }\n\n context.setDataSource(params.removeProperty(\"DATA-DIR\"));\n\n String filterString = params.removeOptionalProperty(\"FILTER\");\n String hasFilter = params.removeProperty(\"HAS-FILTER\");\n if (filterString != null) {\n context.setFilterString(filterString);\n } else if (\"1\".equals(hasFilter)) {\n LOG.info(\"Original query has filter, but it was not propagated to PXF\");\n }\n\n context.setFragmenter(params.removeUserProperty(\"FRAGMENTER\"));\n\n String fragmentIndexStr = params.removeOptionalProperty(\"FRAGMENT-INDEX\");\n if (StringUtils.isNotBlank(fragmentIndexStr)) {\n context.setFragmentIndex(Integer.parseInt(fragmentIndexStr));\n }\n\n String encodedFragmentMetadata = params.removeOptionalProperty(\"FRAGMENT-METADATA\");\n context.setFragmentMetadata(Utilities.parseBase64(encodedFragmentMetadata, \"Fragment metadata information\"));\n context.setHost(params.removeProperty(\"URL-HOST\"));\n context.setMetadata(params.removeUserProperty(\"METADATA\"));\n context.setPort(params.removeIntProperty(\"URL-PORT\"));\n context.setProfileScheme(params.removeUserProperty(PROFILE_SCHEME));\n context.setProtocol(params.removeUserProperty(\"PROTOCOL\"));\n context.setRemoteLogin(params.removeOptionalProperty(\"REMOTE-USER\"));\n context.setRemoteSecret(params.removeOptionalProperty(\"REMOTE-PASS\"));\n context.setResolver(params.removeUserProperty(\"RESOLVER\"));\n context.setSegmentId(params.removeIntProperty(\"SEGMENT-ID\"));\n context.setServerName(params.removeUserProperty(\"SERVER\"));\n\n // An optional CONFIG value specifies the name of the server\n // configuration directory, if not provided the config is the server name\n String config = params.removeUserProperty(\"CONFIG\");\n context.setConfig(StringUtils.isNotBlank(config) ? config : context.getServerName());\n\n String maxFrags = params.removeUserProperty(\"STATS-MAX-FRAGMENTS\");\n if (!StringUtils.isBlank(maxFrags)) {\n context.setStatsMaxFragments(Integer.parseInt(maxFrags));\n }\n\n String sampleRatioStr = params.removeUserProperty(\"STATS-SAMPLE-RATIO\");\n if (!StringUtils.isBlank(sampleRatioStr)) {\n context.setStatsSampleRatio(Float.parseFloat(sampleRatioStr));\n }\n\n context.setTotalSegments(params.removeIntProperty(\"SEGMENT-COUNT\"));\n context.setTransactionId(params.removeProperty(\"XID\"));\n\n // parse tuple description\n parseTupleDescription(params, context);\n\n if (context.getOutputFormat() == OutputFormat.TEXT) {\n // parse CSV format information\n parseGreenplumCSV(params, context);\n\n // Only single column tables support 'OFF' delimiter\n if (context.getTupleDescription().size() != 1 && context.getGreenplumCSV().getDelimiter() == null) {\n throw new IllegalArgumentException(String.format(\"using no delimiter is only possible for a single column table. %d columns found\", context.getTupleDescription().size()));\n }\n }\n\n context.setUser(params.removeProperty(\"USER\"));\n\n String encodedFragmentUserData = params.removeOptionalProperty(\"FRAGMENT-USER-DATA\");\n context.setUserData(Utilities.parseBase64(encodedFragmentUserData, \"Fragment user data\"));\n\n // Store alignment for global use as a system property\n System.setProperty(\"greenplum.alignment\", params.removeProperty(\"ALIGNMENT\"));\n\n Map<String, String> optionMappings = null;\n\n // prepare addition configuration properties if profile was specified\n if (StringUtils.isNotBlank(profile)) {\n optionMappings = pluginConf.getOptionMappings(profile);\n }\n\n // use empty map for convenience instead of null\n if (optionMappings == null) {\n optionMappings = Collections.emptyMap();\n }\n\n Map<String, String> additionalConfigProps = new HashMap<>();\n\n // Iterate over the remaining properties\n // we clone the keyset to prevent concurrent modification exceptions\n List<String> paramNames = new ArrayList<>(params.keySet());\n for (String param : paramNames) {\n if (StringUtils.startsWithIgnoreCase(param, RequestMap.USER_PROP_PREFIX)) {\n // Add all left-over user properties as options\n String optionName = param.toLowerCase().replace(RequestMap.USER_PROP_PREFIX_LOWERCASE, \"\");\n String optionValue = params.removeUserProperty(optionName);\n context.addOption(optionName, optionValue);\n LOG.debug(\"Added option {} to request context\", optionName);\n\n // lookup if the option should also be applied as a config property\n String propertyName = optionMappings.get(optionName);\n if (StringUtils.isNotBlank(propertyName)) {\n // if option has been provided by the user in the request, set the value\n // of the corresponding configuration property\n if (optionValue != null) {\n additionalConfigProps.put(propertyName, optionValue);\n // do not log property value as it might contain sensitive information\n LOG.debug(\"Added extra config property {} from option {}\", propertyName, optionName);\n }\n }\n } else if (StringUtils.startsWithIgnoreCase(param, RequestMap.PROP_PREFIX)) {\n // log debug for all left-over system properties\n LOG.debug(\"Unused property {}\", param);\n }\n }\n\n context.setAdditionalConfigProps(additionalConfigProps);\n context.setPluginConf(pluginConf);\n\n // Call the protocol handler for any protocol-specific logic handling\n if (StringUtils.isNotBlank(profile)) {\n String handlerClassName = pluginConf.getHandler(profile);\n if (StringUtils.isNotBlank(handlerClassName)) {\n Class<?> clazz;\n try {\n clazz = Class.forName(handlerClassName);\n ProtocolHandler handler = (ProtocolHandler) clazz.getDeclaredConstructor().newInstance();\n context.setFragmenter(handler.getFragmenterClassName(context));\n context.setAccessor(handler.getAccessorClassName(context));\n context.setResolver(handler.getResolverClassName(context));\n } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |\n InstantiationException | IllegalAccessException e) {\n throw new RuntimeException(String.format(\"Error when invoking handlerClass '%s' : %s\", handlerClassName, e), e);\n }\n }\n }\n\n // validate that the result has all required fields, and values are in valid ranges\n context.validate();\n\n return context;\n }", "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "invocations": [ "getRequestHeaders", "isDebugEnabled", "debug", "keySet", "setRequestType", "removeUserProperty", "setProfile", "addProfilePlugins", "removeProperty", "setOutputFormat", "valueOf", "removeUserProperty", "isNotBlank", "inferFormatName", "setFormat", "setAccessor", "removeUserProperty", "setAggType", "getAggregationType", "removeOptionalProperty", "removeOptionalProperty", "isNotBlank", "setDataFragment", "parseInt", "setDataSource", "removeProperty", "removeOptionalProperty", "removeProperty", "setFilterString", "equals", "info", "setFragmenter", "removeUserProperty", "removeOptionalProperty", "isNotBlank", "setFragmentIndex", "parseInt", "removeOptionalProperty", "setFragmentMetadata", "parseBase64", "setHost", "removeProperty", "setMetadata", "removeUserProperty", "setPort", "removeIntProperty", "setProfileScheme", "removeUserProperty", "setProtocol", "removeUserProperty", "setRemoteLogin", "removeOptionalProperty", "setRemoteSecret", "removeOptionalProperty", "setResolver", "removeUserProperty", "setSegmentId", "removeIntProperty", "setServerName", "removeUserProperty", "removeUserProperty", "setConfig", "isNotBlank", "getServerName", "removeUserProperty", "isBlank", "setStatsMaxFragments", "parseInt", "removeUserProperty", "isBlank", "setStatsSampleRatio", "parseFloat", "setTotalSegments", "removeIntProperty", "setTransactionId", "removeProperty", "parseTupleDescription", "getOutputFormat", "parseGreenplumCSV", "size", "getTupleDescription", "getDelimiter", "getGreenplumCSV", "format", "size", "getTupleDescription", "setUser", "removeProperty", "removeOptionalProperty", "setUserData", "parseBase64", "setProperty", "removeProperty", "isNotBlank", "getOptionMappings", "emptyMap", "keySet", "startsWithIgnoreCase", "replace", "toLowerCase", "removeUserProperty", "addOption", "debug", "get", "isNotBlank", "put", "debug", "startsWithIgnoreCase", "debug", "setAdditionalConfigProps", "setPluginConf", "isNotBlank", "getHandler", "isNotBlank", "forName", "newInstance", "getDeclaredConstructor", "setFragmenter", "getFragmenterClassName", "setAccessor", "getAccessorClassName", "setResolver", "getResolverClassName", "format", "validate" ], "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_57
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/filter/TreeTraverserTest.java", "identifier": "TreeTraverserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testTraverseLeafNode() {\n Node node = new Node();\n TreeVisitor visitor = mock(TreeVisitor.class);\n when(visitor.before(node, 0)).thenReturn(node);\n when(visitor.visit(node, 0)).thenReturn(node);\n when(visitor.after(node, 0)).thenReturn(node);\n\n Node result = new TreeTraverser().traverse(node, visitor);\n\n verify(visitor).before(node, 0);\n verify(visitor).visit(node, 0);\n verify(visitor).after(node, 0);\n verifyNoMoreInteractions(visitor);\n\n assertSame(node, result);\n }", "class_method_signature": "TreeTraverserTest.testTraverseLeafNode()", "constructor": false, "full_signature": "@Test public void testTraverseLeafNode()", "identifier": "testTraverseLeafNode", "invocations": [ "mock", "thenReturn", "when", "before", "thenReturn", "when", "visit", "thenReturn", "when", "after", "traverse", "before", "verify", "visit", "verify", "after", "verify", "verifyNoMoreInteractions", "assertSame" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testTraverseLeafNode()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(TreeTraverser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(TreeTraverser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/filter/TreeTraverser.java", "identifier": "TreeTraverser", "interfaces": "", "methods": [ { "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor... visitors)", "constructor": false, "full_signature": "public Node traverse(Node node, TreeVisitor... visitors)", "identifier": "traverse", "modifiers": "public", "parameters": "(Node node, TreeVisitor... visitors)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor... visitors)", "testcase": false }, { "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor visitor, final int level)", "constructor": false, "full_signature": "protected Node traverse(Node node, TreeVisitor visitor, final int level)", "identifier": "traverse", "modifiers": "protected", "parameters": "(Node node, TreeVisitor visitor, final int level)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor visitor, final int level)", "testcase": false }, { "class_method_signature": "TreeTraverser.traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "constructor": false, "full_signature": "private void traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "identifier": "traverseHelper", "modifiers": "private", "parameters": "(Node node, int index, TreeVisitor visitor, final int level)", "return": "void", "signature": "void traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "testcase": false } ], "superclass": "" }
{ "body": "public Node traverse(Node node, TreeVisitor... visitors) {\n\n if (ArrayUtils.isEmpty(visitors)) {\n throw new IllegalArgumentException(\"You need to provide at least one visitor for this traverser\");\n }\n\n Node result = node;\n for (TreeVisitor visitor : visitors) {\n result = traverse(result, visitor, 0);\n }\n return result;\n }", "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor... visitors)", "constructor": false, "full_signature": "public Node traverse(Node node, TreeVisitor... visitors)", "identifier": "traverse", "invocations": [ "isEmpty", "traverse" ], "modifiers": "public", "parameters": "(Node node, TreeVisitor... visitors)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor... visitors)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_330
{ "fields": [ { "declarator": "SQL = \"SELECT id, cdate, amt, grade, b FROM sales\"", "modifier": "private static final", "original_string": "private static final String SQL = \"SELECT id, cdate, amt, grade, b FROM sales\";", "type": "String", "var_name": "SQL" }, { "declarator": "NAMED_QUERY = \"SELECT a, b FROM c\"", "modifier": "public static final", "original_string": "public static final String NAMED_QUERY = \"SELECT a, b FROM c\";", "type": "String", "var_name": "NAMED_QUERY" }, { "declarator": "NAMED_QUERY_WHERE = \"SELECT a, b FROM c WHERE d = 'foo'\"", "modifier": "public static final", "original_string": "public static final String NAMED_QUERY_WHERE = \"SELECT a, b FROM c WHERE d = 'foo'\";", "type": "String", "var_name": "NAMED_QUERY_WHERE" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "mockMetaData", "modifier": "@Mock\n private", "original_string": "@Mock\n private DatabaseMetaData mockMetaData;", "type": "DatabaseMetaData", "var_name": "mockMetaData" }, { "declarator": "mockContext", "modifier": "@Mock\n private", "original_string": "@Mock\n private RequestContext mockContext;", "type": "RequestContext", "var_name": "mockContext" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/SQLQueryBuilderTest.java", "identifier": "SQLQueryBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testColumnProjection() throws Exception {\n // id = 1\n context.setFilterString(\"a0c20s1d1o5\");\n context.getTupleDescription().get(1).setProjected(false);\n context.getTupleDescription().get(3).setProjected(false);\n context.getTupleDescription().get(4).setProjected(false);\n\n SQLQueryBuilder builder = new SQLQueryBuilder(context, mockMetaData);\n String query = builder.buildSelectQuery();\n assertEquals(\"SELECT id, amt FROM sales WHERE id = 1\", query);\n }", "class_method_signature": "SQLQueryBuilderTest.testColumnProjection()", "constructor": false, "full_signature": "@Test public void testColumnProjection()", "identifier": "testColumnProjection", "invocations": [ "setFilterString", "setProjected", "get", "getTupleDescription", "setProjected", "get", "getTupleDescription", "setProjected", "get", "getTupleDescription", "buildSelectQuery", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testColumnProjection()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SQLQueryBuilder.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SQLQueryBuilder.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SUBQUERY_ALIAS_SUFFIX = \") pxfsubquery\"", "modifier": "private static final", "original_string": "private static final String SUBQUERY_ALIAS_SUFFIX = \") pxfsubquery\";", "type": "String", "var_name": "SUBQUERY_ALIAS_SUFFIX" }, { "declarator": "SUPPORTED_OPERATORS =\n EnumSet.of(\n Operator.LESS_THAN,\n Operator.GREATER_THAN,\n Operator.LESS_THAN_OR_EQUAL,\n Operator.GREATER_THAN_OR_EQUAL,\n Operator.EQUALS,\n Operator.LIKE,\n Operator.NOT_EQUALS,\n // TODO: In is not supported?\n // Operator.IN,\n Operator.IS_NULL,\n Operator.IS_NOT_NULL,\n Operator.NOOP,\n Operator.AND,\n Operator.NOT,\n Operator.OR\n )", "modifier": "private static final", "original_string": "private static final EnumSet<Operator> SUPPORTED_OPERATORS =\n EnumSet.of(\n Operator.LESS_THAN,\n Operator.GREATER_THAN,\n Operator.LESS_THAN_OR_EQUAL,\n Operator.GREATER_THAN_OR_EQUAL,\n Operator.EQUALS,\n Operator.LIKE,\n Operator.NOT_EQUALS,\n // TODO: In is not supported?\n // Operator.IN,\n Operator.IS_NULL,\n Operator.IS_NOT_NULL,\n Operator.NOOP,\n Operator.AND,\n Operator.NOT,\n Operator.OR\n );", "type": "EnumSet<Operator>", "var_name": "SUPPORTED_OPERATORS" }, { "declarator": "PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS)", "modifier": "private static final", "original_string": "private static final TreeVisitor PRUNER = new SupportedOperatorPruner(SUPPORTED_OPERATORS);", "type": "TreeVisitor", "var_name": "PRUNER" }, { "declarator": "TRAVERSER = new TreeTraverser()", "modifier": "private static final", "original_string": "private static final TreeTraverser TRAVERSER = new TreeTraverser();", "type": "TreeTraverser", "var_name": "TRAVERSER" }, { "declarator": "context", "modifier": "protected final", "original_string": "protected final RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "databaseMetaData", "modifier": "private final", "original_string": "private final DatabaseMetaData databaseMetaData;", "type": "DatabaseMetaData", "var_name": "databaseMetaData" }, { "declarator": "dbProduct", "modifier": "private final", "original_string": "private final DbProduct dbProduct;", "type": "DbProduct", "var_name": "dbProduct" }, { "declarator": "columns", "modifier": "private final", "original_string": "private final List<ColumnDescriptor> columns;", "type": "List<ColumnDescriptor>", "var_name": "columns" }, { "declarator": "source", "modifier": "private final", "original_string": "private final String source;", "type": "String", "var_name": "source" }, { "declarator": "quoteString", "modifier": "private", "original_string": "private String quoteString;", "type": "String", "var_name": "quoteString" }, { "declarator": "subQueryUsed = false", "modifier": "private", "original_string": "private boolean subQueryUsed = false;", "type": "boolean", "var_name": "subQueryUsed" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/SQLQueryBuilder.java", "identifier": "SQLQueryBuilder", "interfaces": "", "methods": [ { "class_method_signature": "SQLQueryBuilder.SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData)", "constructor": true, "full_signature": "public SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData)", "identifier": "SQLQueryBuilder", "modifiers": "public", "parameters": "(RequestContext context, DatabaseMetaData metaData)", "return": "", "signature": " SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData)", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery)", "constructor": true, "full_signature": "public SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery)", "identifier": "SQLQueryBuilder", "modifiers": "public", "parameters": "(RequestContext context, DatabaseMetaData metaData, String subQuery)", "return": "", "signature": " SQLQueryBuilder(RequestContext context, DatabaseMetaData metaData, String subQuery)", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildSelectQuery()", "constructor": false, "full_signature": "public String buildSelectQuery()", "identifier": "buildSelectQuery", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String buildSelectQuery()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildInsertQuery()", "constructor": false, "full_signature": "public String buildInsertQuery()", "identifier": "buildInsertQuery", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String buildInsertQuery()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.autoSetQuoteString()", "constructor": false, "full_signature": "public void autoSetQuoteString()", "identifier": "autoSetQuoteString", "modifiers": "public", "parameters": "()", "return": "void", "signature": "void autoSetQuoteString()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.forceSetQuoteString()", "constructor": false, "full_signature": "public void forceSetQuoteString()", "identifier": "forceSetQuoteString", "modifiers": "public", "parameters": "()", "return": "void", "signature": "void forceSetQuoteString()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildColumnsQuery()", "constructor": false, "full_signature": "protected String buildColumnsQuery()", "identifier": "buildColumnsQuery", "modifiers": "protected", "parameters": "()", "return": "String", "signature": "String buildColumnsQuery()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.getSource()", "constructor": false, "full_signature": "protected String getSource()", "identifier": "getSource", "modifiers": "protected", "parameters": "()", "return": "String", "signature": "String getSource()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.getPredicateBuilder()", "constructor": false, "full_signature": "protected JdbcPredicateBuilder getPredicateBuilder()", "identifier": "getPredicateBuilder", "modifiers": "protected", "parameters": "()", "return": "JdbcPredicateBuilder", "signature": "JdbcPredicateBuilder getPredicateBuilder()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.getPruner()", "constructor": false, "full_signature": "protected TreeVisitor getPruner()", "identifier": "getPruner", "modifiers": "protected", "parameters": "()", "return": "TreeVisitor", "signature": "TreeVisitor getPruner()", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildWhereSQL(StringBuilder query)", "constructor": false, "full_signature": "private void buildWhereSQL(StringBuilder query)", "identifier": "buildWhereSQL", "modifiers": "private", "parameters": "(StringBuilder query)", "return": "void", "signature": "void buildWhereSQL(StringBuilder query)", "testcase": false }, { "class_method_signature": "SQLQueryBuilder.buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "constructor": false, "full_signature": "public void buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "identifier": "buildFragmenterSql", "modifiers": "public", "parameters": "(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "return": "void", "signature": "void buildFragmenterSql(RequestContext context, DbProduct dbProduct, String quoteString, StringBuilder query)", "testcase": false } ], "superclass": "" }
{ "body": "public String buildSelectQuery() {\n StringBuilder sb = new StringBuilder(\"SELECT \")\n .append(buildColumnsQuery())\n .append(\" FROM \")\n .append(getSource());\n\n // Insert regular WHERE constraints\n buildWhereSQL(sb);\n\n // Insert partition constraints\n buildFragmenterSql(context, dbProduct, quoteString, sb);\n\n return sb.toString();\n }", "class_method_signature": "SQLQueryBuilder.buildSelectQuery()", "constructor": false, "full_signature": "public String buildSelectQuery()", "identifier": "buildSelectQuery", "invocations": [ "append", "append", "append", "buildColumnsQuery", "getSource", "buildWhereSQL", "buildFragmenterSql", "toString" ], "modifiers": "public", "parameters": "()", "return": "String", "signature": "String buildSelectQuery()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_275
{ "fields": [ { "declarator": "context", "modifier": "", "original_string": "RequestContext context;", "type": "RequestContext", "var_name": "context" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/StringPassResolverTest.java", "identifier": "StringPassResolverTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n /*\n * Test the setFields method: small input\n */\n public void testSetFields() throws Exception {\n StringPassResolver resolver = buildResolver();\n\n byte[] data = new byte[] {\n (int) 'a',\n (int) 'b',\n (int) 'c',\n (int) 'd',\n (int) '\\n',\n (int) 'n',\n (int) 'o',\n (int) '\\n' };\n\n List<OneField> record = Collections.singletonList(new OneField(DataType.BYTEA.getOID(),\n Arrays.copyOfRange(data, 0, 5)));\n\n OneRow oneRow = resolver.setFields(record);\n verifyOneRow(oneRow, Arrays.copyOfRange(data, 0, 5));\n\n record = Collections.singletonList(new OneField(DataType.BYTEA.getOID(),\n Arrays.copyOfRange(data, 5, 8)));\n\n oneRow = resolver.setFields(record);\n verifyOneRow(oneRow, Arrays.copyOfRange(data, 5, 8));\n }", "class_method_signature": "StringPassResolverTest.testSetFields()", "constructor": false, "full_signature": "@Test /* * Test the setFields method: small input */ public void testSetFields()", "identifier": "testSetFields", "invocations": [ "buildResolver", "singletonList", "getOID", "copyOfRange", "setFields", "verifyOneRow", "copyOfRange", "singletonList", "getOID", "copyOfRange", "setFields", "verifyOneRow", "copyOfRange" ], "modifiers": "@Test /* * Test the setFields method: small input */ public", "parameters": "()", "return": "void", "signature": "void testSetFields()", "testcase": true }
{ "fields": [ { "declarator": "oneRow = new OneRow()", "modifier": "private final", "original_string": "private final OneRow oneRow = new OneRow();", "type": "OneRow", "var_name": "oneRow" }, { "declarator": "resolveWriteCount = 0", "modifier": "private", "original_string": "private int resolveWriteCount = 0;", "type": "int", "var_name": "resolveWriteCount" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/StringPassResolver.java", "identifier": "StringPassResolver", "interfaces": "implements Resolver", "methods": [ { "class_method_signature": "StringPassResolver.getFields(OneRow onerow)", "constructor": false, "full_signature": "@Override public List<OneField> getFields(OneRow onerow)", "identifier": "getFields", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "List<OneField>", "signature": "List<OneField> getFields(OneRow onerow)", "testcase": false }, { "class_method_signature": "StringPassResolver.setFields(List<OneField> record)", "constructor": false, "full_signature": "@Override public OneRow setFields(List<OneField> record)", "identifier": "setFields", "modifiers": "@Override public", "parameters": "(List<OneField> record)", "return": "OneRow", "signature": "OneRow setFields(List<OneField> record)", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "@Override\n public OneRow setFields(List<OneField> record) {\n OneField oneField = record.get(0);\n\n if ((oneField.val instanceof InputStream && resolveWriteCount > 0) ||\n (oneField.val instanceof byte[] && ((byte[]) oneField.val).length == 0)) {\n // For the inputStream case, we only consume the inputStream once\n // and then we need to return null to indicate, during the next\n // iteration, that the stream has been consumed\n return null;\n }\n oneRow.setData(oneField.val);\n resolveWriteCount++;\n return oneRow;\n }", "class_method_signature": "StringPassResolver.setFields(List<OneField> record)", "constructor": false, "full_signature": "@Override public OneRow setFields(List<OneField> record)", "identifier": "setFields", "invocations": [ "get", "setData" ], "modifiers": "@Override public", "parameters": "(List<OneField> record)", "return": "OneRow", "signature": "OneRow setFields(List<OneField> record)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_94
{ "fields": [ { "declarator": "PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_USER_IMPERSONATION" }, { "declarator": "PROPERTY_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\";", "type": "String", "var_name": "PROPERTY_KEY_SERVICE_PRINCIPAL" }, { "declarator": "PROPERTY_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\";", "type": "String", "var_name": "PROPERTY_KEY_SERVICE_KEYTAB" }, { "declarator": "PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_KDC" }, { "declarator": "PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_REALM" }, { "declarator": "userImpersonationEnabled", "modifier": "private static", "original_string": "private static String userImpersonationEnabled;", "type": "String", "var_name": "userImpersonationEnabled" }, { "declarator": "kerberosPrincipal", "modifier": "private static", "original_string": "private static String kerberosPrincipal;", "type": "String", "var_name": "kerberosPrincipal" }, { "declarator": "kerberosKeytab", "modifier": "private static", "original_string": "private static String kerberosKeytab;", "type": "String", "var_name": "kerberosKeytab" }, { "declarator": "kdcDefault", "modifier": "private static", "original_string": "private static String kdcDefault;", "type": "String", "var_name": "kdcDefault" }, { "declarator": "realmDefault", "modifier": "private static", "original_string": "private static String realmDefault;", "type": "String", "var_name": "realmDefault" }, { "declarator": "hostname", "modifier": "private static final", "original_string": "private static final String hostname;", "type": "String", "var_name": "hostname" }, { "declarator": "RESOLVED_PRINCIPAL", "modifier": "private static final", "original_string": "private static final String RESOLVED_PRINCIPAL;", "type": "String", "var_name": "RESOLVED_PRINCIPAL" }, { "declarator": "secureLogin", "modifier": "private", "original_string": "private SecureLogin secureLogin;", "type": "SecureLogin", "var_name": "secureLogin" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "expectedLoginSession", "modifier": "private", "original_string": "private LoginSession expectedLoginSession;", "type": "LoginSession", "var_name": "expectedLoginSession" }, { "declarator": "expectedUGI", "modifier": "private", "original_string": "private UserGroupInformation expectedUGI;", "type": "UserGroupInformation", "var_name": "expectedUGI" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/security/SecureLoginTest.java", "identifier": "SecureLoginTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGlobalImpersonationPropertyAbsent() {\n assertFalse(secureLogin.isUserImpersonationEnabled(configuration));\n }", "class_method_signature": "SecureLoginTest.testGlobalImpersonationPropertyAbsent()", "constructor": false, "full_signature": "@Test public void testGlobalImpersonationPropertyAbsent()", "identifier": "testGlobalImpersonationPropertyAbsent", "invocations": [ "assertFalse", "isUserImpersonationEnabled" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGlobalImpersonationPropertyAbsent()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SecureLogin.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SecureLogin.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "CONFIG_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_PRINCIPAL" }, { "declarator": "CONFIG_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_KEYTAB" }, { "declarator": "CONFIG_KEY_SERVICE_USER_IMPERSONATION = \"pxf.service.user.impersonation\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_USER_IMPERSONATION = \"pxf.service.user.impersonation\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_USER_IMPERSONATION" }, { "declarator": "CONFIG_KEY_SERVICE_USER_NAME = \"pxf.service.user.name\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_USER_NAME = \"pxf.service.user.name\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_USER_NAME" }, { "declarator": "PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_USER_IMPERSONATION" }, { "declarator": "loginMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, LoginSession> loginMap = new HashMap<>();", "type": "Map<String, LoginSession>", "var_name": "loginMap" }, { "declarator": "instance = new SecureLogin()", "modifier": "private static final", "original_string": "private static final SecureLogin instance = new SecureLogin();", "type": "SecureLogin", "var_name": "instance" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/security/SecureLogin.java", "identifier": "SecureLogin", "interfaces": "", "methods": [ { "class_method_signature": "SecureLogin.SecureLogin()", "constructor": true, "full_signature": "private SecureLogin()", "identifier": "SecureLogin", "modifiers": "private", "parameters": "()", "return": "", "signature": " SecureLogin()", "testcase": false }, { "class_method_signature": "SecureLogin.getInstance()", "constructor": false, "full_signature": "public static SecureLogin getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "SecureLogin", "signature": "SecureLogin getInstance()", "testcase": false }, { "class_method_signature": "SecureLogin.getLoginUser(RequestContext context, Configuration configuration)", "constructor": false, "full_signature": "public UserGroupInformation getLoginUser(RequestContext context, Configuration configuration)", "identifier": "getLoginUser", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration)", "return": "UserGroupInformation", "signature": "UserGroupInformation getLoginUser(RequestContext context, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getLoginUser(String serverName, String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "public UserGroupInformation getLoginUser(String serverName, String configDirectory, Configuration configuration)", "identifier": "getLoginUser", "modifiers": "public", "parameters": "(String serverName, String configDirectory, Configuration configuration)", "return": "UserGroupInformation", "signature": "UserGroupInformation getLoginUser(String serverName, String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.login(String serverName, String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "private LoginSession login(String serverName, String configDirectory, Configuration configuration)", "identifier": "login", "modifiers": "private", "parameters": "(String serverName, String configDirectory, Configuration configuration)", "return": "LoginSession", "signature": "LoginSession login(String serverName, String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.isUserImpersonationEnabled(Configuration configuration)", "constructor": false, "full_signature": "public boolean isUserImpersonationEnabled(Configuration configuration)", "identifier": "isUserImpersonationEnabled", "modifiers": "public", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isUserImpersonationEnabled(Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "private LoginSession getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "identifier": "getServerLoginSession", "modifiers": "private", "parameters": "(final String serverName, final String configDirectory, Configuration configuration)", "return": "LoginSession", "signature": "LoginSession getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServicePrincipal(String serverName, Configuration configuration)", "constructor": false, "full_signature": " String getServicePrincipal(String serverName, Configuration configuration)", "identifier": "getServicePrincipal", "modifiers": "", "parameters": "(String serverName, Configuration configuration)", "return": "String", "signature": "String getServicePrincipal(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServiceKeytab(String serverName, Configuration configuration)", "constructor": false, "full_signature": " String getServiceKeytab(String serverName, Configuration configuration)", "identifier": "getServiceKeytab", "modifiers": "", "parameters": "(String serverName, Configuration configuration)", "return": "String", "signature": "String getServiceKeytab(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getLocalHostName(@Nullable Configuration conf)", "constructor": false, "full_signature": "private String getLocalHostName(@Nullable Configuration conf)", "identifier": "getLocalHostName", "modifiers": "private", "parameters": "(@Nullable Configuration conf)", "return": "String", "signature": "String getLocalHostName(@Nullable Configuration conf)", "testcase": false }, { "class_method_signature": "SecureLogin.reset()", "constructor": false, "full_signature": "static void reset()", "identifier": "reset", "modifiers": "static", "parameters": "()", "return": "void", "signature": "void reset()", "testcase": false }, { "class_method_signature": "SecureLogin.getCache()", "constructor": false, "full_signature": "static Map<String, LoginSession> getCache()", "identifier": "getCache", "modifiers": "static", "parameters": "()", "return": "Map<String, LoginSession>", "signature": "Map<String, LoginSession> getCache()", "testcase": false }, { "class_method_signature": "SecureLogin.addToCache(String server, LoginSession session)", "constructor": false, "full_signature": "static void addToCache(String server, LoginSession session)", "identifier": "addToCache", "modifiers": "static", "parameters": "(String server, LoginSession session)", "return": "void", "signature": "void addToCache(String server, LoginSession session)", "testcase": false } ], "superclass": "" }
{ "body": "public boolean isUserImpersonationEnabled(Configuration configuration) {\n String valueFromUserImpersonationOnServer = configuration.get(SecureLogin.CONFIG_KEY_SERVICE_USER_IMPERSONATION, System.getProperty(PROPERTY_KEY_USER_IMPERSONATION, \"false\"));\n return StringUtils.equalsIgnoreCase(valueFromUserImpersonationOnServer, \"true\");\n }", "class_method_signature": "SecureLogin.isUserImpersonationEnabled(Configuration configuration)", "constructor": false, "full_signature": "public boolean isUserImpersonationEnabled(Configuration configuration)", "identifier": "isUserImpersonationEnabled", "invocations": [ "get", "getProperty", "equalsIgnoreCase" ], "modifiers": "public", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isUserImpersonationEnabled(Configuration configuration)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_127
{ "fields": [ { "declarator": "MINUTES = 60 * 1000L", "modifier": "private static final", "original_string": "private static final long MINUTES = 60 * 1000L;", "type": "long", "var_name": "MINUTES" }, { "declarator": "provider = null", "modifier": "private", "original_string": "private UGIProvider provider = null;", "type": "UGIProvider", "var_name": "provider" }, { "declarator": "session = null", "modifier": "private", "original_string": "private SessionId session = null;", "type": "SessionId", "var_name": "session" }, { "declarator": "cache = null", "modifier": "private", "original_string": "private UGICache cache = null;", "type": "UGICache", "var_name": "cache" }, { "declarator": "fakeTicker", "modifier": "private", "original_string": "private FakeTicker fakeTicker;", "type": "FakeTicker", "var_name": "fakeTicker" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/UGICacheTest.java", "identifier": "UGICacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getUGIWithEquivalentSessionsReturnsTheSameInstance() throws Exception {\n SessionId session2 = new SessionId(0, \"txn-id\", \"the-user\", \"default\");\n UserGroupInformation ugi1 = cache.getUserGroupInformation(session, false);\n UserGroupInformation ugi2 = cache.getUserGroupInformation(session2, false);\n assertEquals(ugi1, ugi2);\n }", "class_method_signature": "UGICacheTest.getUGIWithEquivalentSessionsReturnsTheSameInstance()", "constructor": false, "full_signature": "@Test public void getUGIWithEquivalentSessionsReturnsTheSameInstance()", "identifier": "getUGIWithEquivalentSessionsReturnsTheSameInstance", "invocations": [ "getUserGroupInformation", "getUserGroupInformation", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getUGIWithEquivalentSessionsReturnsTheSameInstance()", "testcase": true }
{ "fields": [ { "declarator": "NANOS_PER_MILLIS = 1000000", "modifier": "static final", "original_string": "static final int NANOS_PER_MILLIS = 1000000;", "type": "int", "var_name": "NANOS_PER_MILLIS" }, { "declarator": "UGI_CACHE_EXPIRY = 15 * 60 * 1000L", "modifier": "static final", "original_string": "static final long UGI_CACHE_EXPIRY = 15 * 60 * 1000L;", "type": "long", "var_name": "UGI_CACHE_EXPIRY" }, { "declarator": "LOG = LoggerFactory.getLogger(UGICache.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(UGICache.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "cache = new ConcurrentHashMap<>()", "modifier": "private final", "original_string": "private final Map<SessionId, Entry> cache = new ConcurrentHashMap<>();", "type": "Map<SessionId, Entry>", "var_name": "cache" }, { "declarator": "expirationQueueMap = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<Integer, DelayQueue<Entry>> expirationQueueMap = new HashMap<>();", "type": "Map<Integer, DelayQueue<Entry>>", "var_name": "expirationQueueMap" }, { "declarator": "ugiProvider", "modifier": "private final", "original_string": "private final UGIProvider ugiProvider;", "type": "UGIProvider", "var_name": "ugiProvider" }, { "declarator": "ticker", "modifier": "private final", "original_string": "private final Ticker ticker;", "type": "Ticker", "var_name": "ticker" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/UGICache.java", "identifier": "UGICache", "interfaces": "", "methods": [ { "class_method_signature": "UGICache.UGICache(UGIProvider provider, Ticker ticker)", "constructor": true, "full_signature": " UGICache(UGIProvider provider, Ticker ticker)", "identifier": "UGICache", "modifiers": "", "parameters": "(UGIProvider provider, Ticker ticker)", "return": "", "signature": " UGICache(UGIProvider provider, Ticker ticker)", "testcase": false }, { "class_method_signature": "UGICache.UGICache()", "constructor": true, "full_signature": "public UGICache()", "identifier": "UGICache", "modifiers": "public", "parameters": "()", "return": "", "signature": " UGICache()", "testcase": false }, { "class_method_signature": "UGICache.getUserGroupInformation(SessionId session, boolean isProxyUser)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "identifier": "getUserGroupInformation", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean isProxyUser)", "return": "UserGroupInformation", "signature": "UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "testcase": false }, { "class_method_signature": "UGICache.release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "identifier": "release", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean cleanImmediatelyIfNoRefs)", "return": "void", "signature": "void release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "testcase": false }, { "class_method_signature": "UGICache.size()", "constructor": false, "full_signature": " int size()", "identifier": "size", "modifiers": "", "parameters": "()", "return": "int", "signature": "int size()", "testcase": false }, { "class_method_signature": "UGICache.allQueuesSize()", "constructor": false, "full_signature": " int allQueuesSize()", "identifier": "allQueuesSize", "modifiers": "", "parameters": "()", "return": "int", "signature": "int allQueuesSize()", "testcase": false }, { "class_method_signature": "UGICache.contains(SessionId session)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") boolean contains(SessionId session)", "identifier": "contains", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\")", "parameters": "(SessionId session)", "return": "boolean", "signature": "boolean contains(SessionId session)", "testcase": false }, { "class_method_signature": "UGICache.getExpirationQueue(Integer segmentId)", "constructor": false, "full_signature": "private DelayQueue<Entry> getExpirationQueue(Integer segmentId)", "identifier": "getExpirationQueue", "modifiers": "private", "parameters": "(Integer segmentId)", "return": "DelayQueue<Entry>", "signature": "DelayQueue<Entry> getExpirationQueue(Integer segmentId)", "testcase": false }, { "class_method_signature": "UGICache.cleanup(DelayQueue<Entry> expirationQueue)", "constructor": false, "full_signature": "private void cleanup(DelayQueue<Entry> expirationQueue)", "identifier": "cleanup", "modifiers": "private", "parameters": "(DelayQueue<Entry> expirationQueue)", "return": "void", "signature": "void cleanup(DelayQueue<Entry> expirationQueue)", "testcase": false }, { "class_method_signature": "UGICache.closeUGI(Entry expiredUGI)", "constructor": false, "full_signature": "private void closeUGI(Entry expiredUGI)", "identifier": "closeUGI", "modifiers": "private", "parameters": "(Entry expiredUGI)", "return": "void", "signature": "void closeUGI(Entry expiredUGI)", "testcase": false } ], "superclass": "" }
{ "body": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\")\n public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser) throws IOException {\n Integer segmentId = session.getSegmentId();\n String user = session.getUser();\n DelayQueue<Entry> delayQueue = getExpirationQueue(segmentId);\n synchronized (delayQueue) {\n // Use the opportunity to cleanup any expired entries\n cleanup(delayQueue);\n Entry entry = cache.get(session);\n if (entry == null) {\n\n UserGroupInformation ugi;\n if (isProxyUser) {\n LOG.debug(\"{} Creating proxy user = {}\", session, user);\n ugi = ugiProvider.createProxyUGI(user, session.getLoginUser());\n } else {\n LOG.debug(\"{} Creating remote user = {}\", session, user);\n ugi = ugiProvider.createRemoteUser(user, session);\n }\n entry = new Entry(ticker, ugi, session);\n delayQueue.offer(entry);\n cache.put(session, entry);\n }\n entry.incrementRefCount();\n return entry.getUGI();\n }\n }", "class_method_signature": "UGICache.getUserGroupInformation(SessionId session, boolean isProxyUser)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "identifier": "getUserGroupInformation", "invocations": [ "getSegmentId", "getUser", "getExpirationQueue", "cleanup", "get", "debug", "createProxyUGI", "getLoginUser", "debug", "createRemoteUser", "offer", "put", "incrementRefCount", "getUGI" ], "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean isProxyUser)", "return": "UserGroupInformation", "signature": "UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_259
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS_Spaces() {\n avroUtilities = new AvroUtilities((file) -> dontFindLocalFile());\n context.setRequestType(RequestContext.RequestType.WRITE_BRIDGE);\n context.addOption(\"SCHEMA\", avroDirectory + \"user provided.avsc\");\n context.setDataSource(avroDirectory);\n\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifySchema(schema, \"user_provided_schema\");\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS_Spaces()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS_Spaces()", "identifier": "testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS_Spaces", "invocations": [ "dontFindLocalFile", "setRequestType", "addOption", "setDataSource", "obtainSchema", "verifySchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnWrite_WithUserProvidedSchema_Json_HCFS_Spaces()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_170
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/profile/ProfilesConfTest.java", "identifier": "ProfilesConfTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void definedProfile() {\n ProfilesConf profilesConf = getProfilesConf(\"definedProfile\");\n Map<String, String> hbaseProfile = profilesConf.getPlugins(\"HBase\");\n assertEquals(2, hbaseProfile.keySet().size());\n assertEquals(\"X\", hbaseProfile.get(\"OUTPUTFORMAT\"));\n assertEquals(\"XX\", hbaseProfile.get(\"METADATA\"));\n\n // case insensitive profile name\n Map<String, String> hiveProfile = profilesConf.getPlugins(\"hIVe\");\n assertEquals(1, hiveProfile.keySet().size());\n assertEquals(\"Y\", hiveProfile.get(\"OUTPUTFORMAT\"));\n }", "class_method_signature": "ProfilesConfTest.definedProfile()", "constructor": false, "full_signature": "@Test public void definedProfile()", "identifier": "definedProfile", "invocations": [ "getProfilesConf", "getPlugins", "assertEquals", "size", "keySet", "assertEquals", "get", "assertEquals", "get", "getPlugins", "assertEquals", "size", "keySet", "assertEquals", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void definedProfile()", "testcase": true }
{ "fields": [ { "declarator": "EXTERNAL_PROFILES = \"pxf-profiles.xml\"", "modifier": "private final static", "original_string": "private final static String EXTERNAL_PROFILES = \"pxf-profiles.xml\";", "type": "String", "var_name": "EXTERNAL_PROFILES" }, { "declarator": "INTERNAL_PROFILES = \"pxf-profiles-default.xml\"", "modifier": "private final static", "original_string": "private final static String INTERNAL_PROFILES = \"pxf-profiles-default.xml\";", "type": "String", "var_name": "INTERNAL_PROFILES" }, { "declarator": "LOG = LoggerFactory.getLogger(ProfilesConf.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(ProfilesConf.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "INSTANCE = new ProfilesConf()", "modifier": "private final static", "original_string": "private final static ProfilesConf INSTANCE = new ProfilesConf();", "type": "ProfilesConf", "var_name": "INSTANCE" }, { "declarator": "externalProfilesFilename", "modifier": "private final", "original_string": "private final String externalProfilesFilename;", "type": "String", "var_name": "externalProfilesFilename" }, { "declarator": "profilesMap", "modifier": "private", "original_string": "private Map<String, Profile> profilesMap;", "type": "Map<String, Profile>", "var_name": "profilesMap" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/profile/ProfilesConf.java", "identifier": "ProfilesConf", "interfaces": "implements PluginConf", "methods": [ { "class_method_signature": "ProfilesConf.ProfilesConf()", "constructor": true, "full_signature": "private ProfilesConf()", "identifier": "ProfilesConf", "modifiers": "private", "parameters": "()", "return": "", "signature": " ProfilesConf()", "testcase": false }, { "class_method_signature": "ProfilesConf.ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "constructor": true, "full_signature": " ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "identifier": "ProfilesConf", "modifiers": "", "parameters": "(String internalProfilesFilename, String externalProfilesFilename)", "return": "", "signature": " ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "testcase": false }, { "class_method_signature": "ProfilesConf.getInstance()", "constructor": false, "full_signature": "public static ProfilesConf getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "ProfilesConf", "signature": "ProfilesConf getInstance()", "testcase": false }, { "class_method_signature": "ProfilesConf.getOptionMappings(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getOptionMappings(String profileName)", "identifier": "getOptionMappings", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getOptionMappings(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getPlugins(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getPlugins(String profileName)", "identifier": "getPlugins", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getPlugins(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getProtocol(String profileName)", "constructor": false, "full_signature": "@Override public String getProtocol(String profileName)", "identifier": "getProtocol", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "String", "signature": "String getProtocol(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getHandler(String profileName)", "constructor": false, "full_signature": "@Override public String getHandler(String profileName)", "identifier": "getHandler", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "String", "signature": "String getHandler(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getProfile(String profileName)", "constructor": false, "full_signature": "private Profile getProfile(String profileName)", "identifier": "getProfile", "modifiers": "private", "parameters": "(String profileName)", "return": "Profile", "signature": "Profile getProfile(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.loadConf(String fileName, boolean isMandatory)", "constructor": false, "full_signature": "private void loadConf(String fileName, boolean isMandatory)", "identifier": "loadConf", "modifiers": "private", "parameters": "(String fileName, boolean isMandatory)", "return": "void", "signature": "void loadConf(String fileName, boolean isMandatory)", "testcase": false }, { "class_method_signature": "ProfilesConf.getClassLoader()", "constructor": false, "full_signature": "private ClassLoader getClassLoader()", "identifier": "getClassLoader", "modifiers": "private", "parameters": "()", "return": "ClassLoader", "signature": "ClassLoader getClassLoader()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public Map<String, String> getPlugins(String profileName) {\n Profile profile = getProfile(profileName);\n Map<String, String> result = profile.getPluginsMap();\n if (result.isEmpty()) {\n throw new ProfileConfException(NO_PLUGINS_IN_PROFILE_DEF, profileName, externalProfilesFilename);\n }\n return result;\n }", "class_method_signature": "ProfilesConf.getPlugins(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getPlugins(String profileName)", "identifier": "getPlugins", "invocations": [ "getProfile", "getPluginsMap", "isEmpty" ], "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getPlugins(String profileName)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_189
{ "fields": [ { "declarator": "response = null", "modifier": "", "original_string": "MetadataResponse response = null;", "type": "MetadataResponse", "var_name": "response" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/MetadataResponseFormatterTest.java", "identifier": "MetadataResponseFormatterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void formatResponseStringWithModifiers() throws Exception {\n List<Metadata> metadataList = new ArrayList<Metadata>();\n List<Metadata.Field> fields = new ArrayList<Metadata.Field>();\n Metadata.Item itemName = new Metadata.Item(\"default\", \"table1\");\n Metadata metadata = new Metadata(itemName, fields);\n fields.add(new Metadata.Field(\"field1\", EnumGpdbType.Int8Type, \"bigint\"));\n fields.add(new Metadata.Field(\"field2\", EnumGpdbType.NumericType, \"decimal\",\n new String[] {\"1349\", \"1789\"}));\n fields.add(new Metadata.Field(\"field3\", EnumGpdbType.BpcharType, \"char\",\n new String[] {\"50\"}));\n metadataList.add(metadata);\n\n response = MetadataResponseFormatter.formatResponse(metadataList, \"path.file\");\n StringBuilder expected = new StringBuilder(\"{\\\"PXFMetadata\\\":[{\");\n expected.append(\"\\\"item\\\":{\\\"path\\\":\\\"default\\\",\\\"name\\\":\\\"table1\\\"},\")\n .append(\"\\\"fields\\\":[\")\n .append(\"{\\\"name\\\":\\\"field1\\\",\\\"type\\\":\\\"int8\\\",\\\"sourceType\\\":\\\"bigint\\\",\\\"complexType\\\":false},\")\n .append(\"{\\\"name\\\":\\\"field2\\\",\\\"type\\\":\\\"numeric\\\",\\\"sourceType\\\":\\\"decimal\\\",\\\"modifiers\\\":[\\\"1349\\\",\\\"1789\\\"],\\\"complexType\\\":false},\")\n .append(\"{\\\"name\\\":\\\"field3\\\",\\\"type\\\":\\\"bpchar\\\",\\\"sourceType\\\":\\\"char\\\",\\\"modifiers\\\":[\\\"50\\\"],\\\"complexType\\\":false}\")\n .append(\"]}]}\");\n\n assertEquals(expected.toString(), convertResponseToString(response));\n }", "class_method_signature": "MetadataResponseFormatterTest.formatResponseStringWithModifiers()", "constructor": false, "full_signature": "@Test public void formatResponseStringWithModifiers()", "identifier": "formatResponseStringWithModifiers", "invocations": [ "add", "add", "add", "add", "formatResponse", "append", "append", "append", "append", "append", "append", "assertEquals", "toString", "convertResponseToString" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void formatResponseStringWithModifiers()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(MetadataResponseFormatter.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(MetadataResponseFormatter.class);", "type": "Log", "var_name": "LOG" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/MetadataResponseFormatter.java", "identifier": "MetadataResponseFormatter", "interfaces": "", "methods": [ { "class_method_signature": "MetadataResponseFormatter.formatResponse(List<Metadata> metadataList, String path)", "constructor": false, "full_signature": "public static MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "identifier": "formatResponse", "modifiers": "public static", "parameters": "(List<Metadata> metadataList, String path)", "return": "MetadataResponse", "signature": "MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "testcase": false }, { "class_method_signature": "MetadataResponseFormatter.printMetadata(List<Metadata> metadataList, String path)", "constructor": false, "full_signature": "private static void printMetadata(List<Metadata> metadataList, String path)", "identifier": "printMetadata", "modifiers": "private static", "parameters": "(List<Metadata> metadataList, String path)", "return": "void", "signature": "void printMetadata(List<Metadata> metadataList, String path)", "testcase": false } ], "superclass": "" }
{ "body": "public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException {\n /* print the fragment list to log when in debug level */\n if (LOG.isDebugEnabled()) {\n MetadataResponseFormatter.printMetadata(metadataList, path);\n }\n\n return new MetadataResponse(metadataList);\n }", "class_method_signature": "MetadataResponseFormatter.formatResponse(List<Metadata> metadataList, String path)", "constructor": false, "full_signature": "public static MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "identifier": "formatResponse", "invocations": [ "isDebugEnabled", "printMetadata" ], "modifiers": "public static", "parameters": "(List<Metadata> metadataList, String path)", "return": "MetadataResponse", "signature": "MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_166
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "filter", "modifier": "private", "original_string": "private SecurityServletFilter filter;", "type": "SecurityServletFilter", "var_name": "filter" }, { "declarator": "mockServletRequest", "modifier": "@Mock private", "original_string": "@Mock private HttpServletRequest mockServletRequest;", "type": "HttpServletRequest", "var_name": "mockServletRequest" }, { "declarator": "mockServletResponse", "modifier": "@Mock private", "original_string": "@Mock private ServletResponse mockServletResponse;", "type": "ServletResponse", "var_name": "mockServletResponse" }, { "declarator": "mockFilterChain", "modifier": "@Mock private", "original_string": "@Mock private FilterChain mockFilterChain;", "type": "FilterChain", "var_name": "mockFilterChain" }, { "declarator": "mockConfigurationFactory", "modifier": "@Mock private", "original_string": "@Mock private ConfigurationFactory mockConfigurationFactory;", "type": "ConfigurationFactory", "var_name": "mockConfigurationFactory" }, { "declarator": "mockSecureLogin", "modifier": "@Mock private", "original_string": "@Mock private SecureLogin mockSecureLogin;", "type": "SecureLogin", "var_name": "mockSecureLogin" }, { "declarator": "mockUGICache", "modifier": "@Mock private", "original_string": "@Mock private UGICache mockUGICache;", "type": "UGICache", "var_name": "mockUGICache" }, { "declarator": "mockConfiguration", "modifier": "@Mock private", "original_string": "@Mock private Configuration mockConfiguration;", "type": "Configuration", "var_name": "mockConfiguration" }, { "declarator": "mockLoginUGI", "modifier": "@Mock private", "original_string": "@Mock private UserGroupInformation mockLoginUGI;", "type": "UserGroupInformation", "var_name": "mockLoginUGI" }, { "declarator": "mockProxyUGI", "modifier": "@Mock private", "original_string": "@Mock private UserGroupInformation mockProxyUGI;", "type": "UserGroupInformation", "var_name": "mockProxyUGI" }, { "declarator": "session", "modifier": "@Captor private", "original_string": "@Captor private ArgumentCaptor<SessionId> session;", "type": "ArgumentCaptor<SessionId>", "var_name": "session" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/servlet/SecurityServletFilterTest.java", "identifier": "SecurityServletFilterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void doesNotCleanTheUGICacheOnNonLastCalls() throws Exception {\n expectScenario(false, false, false);\n filter.doFilter(mockServletRequest, mockServletResponse, mockFilterChain);\n verifyScenario(\"login-user\", false);\n verify(mockUGICache).release(any(SessionId.class), eq(false));\n }", "class_method_signature": "SecurityServletFilterTest.doesNotCleanTheUGICacheOnNonLastCalls()", "constructor": false, "full_signature": "@Test public void doesNotCleanTheUGICacheOnNonLastCalls()", "identifier": "doesNotCleanTheUGICacheOnNonLastCalls", "invocations": [ "expectScenario", "doFilter", "verifyScenario", "release", "verify", "any", "eq" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void doesNotCleanTheUGICacheOnNonLastCalls()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SecurityServletFilter.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SecurityServletFilter.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "CONFIG_HEADER = \"X-GP-OPTIONS-CONFIG\"", "modifier": "private static final", "original_string": "private static final String CONFIG_HEADER = \"X-GP-OPTIONS-CONFIG\";", "type": "String", "var_name": "CONFIG_HEADER" }, { "declarator": "USER_HEADER = \"X-GP-USER\"", "modifier": "private static final", "original_string": "private static final String USER_HEADER = \"X-GP-USER\";", "type": "String", "var_name": "USER_HEADER" }, { "declarator": "SEGMENT_ID_HEADER = \"X-GP-SEGMENT-ID\"", "modifier": "private static final", "original_string": "private static final String SEGMENT_ID_HEADER = \"X-GP-SEGMENT-ID\";", "type": "String", "var_name": "SEGMENT_ID_HEADER" }, { "declarator": "SERVER_HEADER = \"X-GP-OPTIONS-SERVER\"", "modifier": "private static final", "original_string": "private static final String SERVER_HEADER = \"X-GP-OPTIONS-SERVER\";", "type": "String", "var_name": "SERVER_HEADER" }, { "declarator": "TRANSACTION_ID_HEADER = \"X-GP-XID\"", "modifier": "private static final", "original_string": "private static final String TRANSACTION_ID_HEADER = \"X-GP-XID\";", "type": "String", "var_name": "TRANSACTION_ID_HEADER" }, { "declarator": "LAST_FRAGMENT_HEADER = \"X-GP-LAST-FRAGMENT\"", "modifier": "private static final", "original_string": "private static final String LAST_FRAGMENT_HEADER = \"X-GP-LAST-FRAGMENT\";", "type": "String", "var_name": "LAST_FRAGMENT_HEADER" }, { "declarator": "MISSING_HEADER_ERROR = \"Header %s is missing in the request\"", "modifier": "private static final", "original_string": "private static final String MISSING_HEADER_ERROR = \"Header %s is missing in the request\";", "type": "String", "var_name": "MISSING_HEADER_ERROR" }, { "declarator": "EMPTY_HEADER_ERROR = \"Header %s is empty in the request\"", "modifier": "private static final", "original_string": "private static final String EMPTY_HEADER_ERROR = \"Header %s is empty in the request\";", "type": "String", "var_name": "EMPTY_HEADER_ERROR" }, { "declarator": "ugiCache", "modifier": "private", "original_string": "private UGICache ugiCache;", "type": "UGICache", "var_name": "ugiCache" }, { "declarator": "configurationFactory", "modifier": "private final", "original_string": "private final ConfigurationFactory configurationFactory;", "type": "ConfigurationFactory", "var_name": "configurationFactory" }, { "declarator": "secureLogin", "modifier": "private final", "original_string": "private final SecureLogin secureLogin;", "type": "SecureLogin", "var_name": "secureLogin" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/servlet/SecurityServletFilter.java", "identifier": "SecurityServletFilter", "interfaces": "implements Filter", "methods": [ { "class_method_signature": "SecurityServletFilter.SecurityServletFilter()", "constructor": true, "full_signature": "public SecurityServletFilter()", "identifier": "SecurityServletFilter", "modifiers": "public", "parameters": "()", "return": "", "signature": " SecurityServletFilter()", "testcase": false }, { "class_method_signature": "SecurityServletFilter.SecurityServletFilter(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "constructor": true, "full_signature": " SecurityServletFilter(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "identifier": "SecurityServletFilter", "modifiers": "", "parameters": "(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "return": "", "signature": " SecurityServletFilter(ConfigurationFactory configurationFactory, SecureLogin secureLogin, UGICache ugiCache)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.init(FilterConfig filterConfig)", "constructor": false, "full_signature": "@Override public void init(FilterConfig filterConfig)", "identifier": "init", "modifiers": "@Override public", "parameters": "(FilterConfig filterConfig)", "return": "void", "signature": "void init(FilterConfig filterConfig)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "constructor": false, "full_signature": "@Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "identifier": "doFilter", "modifiers": "@Override public", "parameters": "(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "return": "void", "signature": "void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.destroy()", "constructor": false, "full_signature": "@Override public void destroy()", "identifier": "destroy", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void destroy()", "testcase": false }, { "class_method_signature": "SecurityServletFilter.getHeaderValueInt(ServletRequest request, String headerKey, boolean required)", "constructor": false, "full_signature": "private Integer getHeaderValueInt(ServletRequest request, String headerKey, boolean required)", "identifier": "getHeaderValueInt", "modifiers": "private", "parameters": "(ServletRequest request, String headerKey, boolean required)", "return": "Integer", "signature": "Integer getHeaderValueInt(ServletRequest request, String headerKey, boolean required)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.getHeaderValue(ServletRequest request, String headerKey, boolean required)", "constructor": false, "full_signature": "private String getHeaderValue(ServletRequest request, String headerKey, boolean required)", "identifier": "getHeaderValue", "modifiers": "private", "parameters": "(ServletRequest request, String headerKey, boolean required)", "return": "String", "signature": "String getHeaderValue(ServletRequest request, String headerKey, boolean required)", "testcase": false }, { "class_method_signature": "SecurityServletFilter.getHeaderValueBoolean(ServletRequest request, String headerKey, boolean required)", "constructor": false, "full_signature": "private boolean getHeaderValueBoolean(ServletRequest request, String headerKey, boolean required)", "identifier": "getHeaderValueBoolean", "modifiers": "private", "parameters": "(ServletRequest request, String headerKey, boolean required)", "return": "boolean", "signature": "boolean getHeaderValueBoolean(ServletRequest request, String headerKey, boolean required)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)\n throws IOException, ServletException {\n\n // retrieve user header and make sure header is present and is not empty\n final String gpdbUser = getHeaderValue(request, USER_HEADER, true);\n final String transactionId = getHeaderValue(request, TRANSACTION_ID_HEADER, true);\n final Integer segmentId = getHeaderValueInt(request, SEGMENT_ID_HEADER, true);\n final boolean lastCallForSegment = getHeaderValueBoolean(request, LAST_FRAGMENT_HEADER, false);\n\n final String serverName = StringUtils.defaultIfBlank(getHeaderValue(request, SERVER_HEADER, false), \"default\");\n final String configDirectory = StringUtils.defaultIfBlank(getHeaderValue(request, CONFIG_HEADER, false), serverName);\n final Configuration configuration = configurationFactory.initConfiguration(configDirectory, serverName, gpdbUser, null);\n final boolean isUserImpersonation = secureLogin.isUserImpersonationEnabled(configuration);\n final boolean isSecurityEnabled = Utilities.isSecurityEnabled(configuration);\n\n // Establish the UGI for the login user or the Kerberos principal for the given server, if applicable\n UserGroupInformation loginUser = secureLogin.getLoginUser(serverName, configDirectory, configuration);\n\n String serviceUser = loginUser.getUserName();\n\n if (!isUserImpersonation && isSecurityEnabled) {\n // When impersonation is disabled and security is enabled\n // we check whether the pxf.service.user.name property was provided\n // and if provided we use the value as the remote user instead of\n // the principal defined in pxf.service.kerberos.principal. However,\n // the principal will need to have proxy privileges on hadoop.\n String pxfServiceUserName = configuration.get(SecureLogin.CONFIG_KEY_SERVICE_USER_NAME);\n if (StringUtils.isNotBlank(pxfServiceUserName)) {\n serviceUser = pxfServiceUserName;\n }\n }\n\n String remoteUser = (isUserImpersonation ? gpdbUser : serviceUser);\n\n SessionId session = new SessionId(\n segmentId,\n transactionId,\n remoteUser,\n serverName,\n isSecurityEnabled,\n loginUser);\n\n final String serviceUserName = serviceUser;\n\n // Prepare privileged action to run on behalf of proxy user\n PrivilegedExceptionAction<Boolean> action = () -> {\n LOG.debug(\"Performing request for gpdb_user = {} as [remote_user = {} service_user = {} login_user ={}] with{} impersonation\",\n gpdbUser, remoteUser, serviceUserName, loginUser.getUserName(), isUserImpersonation ? \"\" : \"out\");\n chain.doFilter(request, response);\n return true;\n };\n\n boolean exceptionDetected = false;\n try {\n // Retrieve proxy user UGI from the UGI of the logged in user\n UserGroupInformation userGroupInformation = ugiCache\n .getUserGroupInformation(session, isUserImpersonation);\n\n LOG.debug(\"Retrieved proxy user {} for server {} and session {}\", userGroupInformation, serverName, session);\n\n // Execute the servlet chain as that user\n userGroupInformation.doAs(action);\n } catch (UndeclaredThrowableException ute) {\n exceptionDetected = true;\n // unwrap the real exception thrown by the action\n throw new ServletException(ute.getCause());\n } catch (InterruptedException ie) {\n exceptionDetected = true;\n throw new ServletException(ie);\n } finally {\n // Optimization to cleanup the cache if it is the last fragment\n boolean releaseUgi = lastCallForSegment || exceptionDetected;\n LOG.debug(\"Releasing UGI from cache for session: {}. {}\",\n session, exceptionDetected\n ? \" Exception while processing\"\n : (lastCallForSegment ? \" Processed last fragment for segment\" : \"\"));\n try {\n ugiCache.release(session, releaseUgi);\n } catch (Throwable t) {\n LOG.error(\"Error releasing UGI from cache for session: {}\", session, t);\n }\n if (releaseUgi) {\n LOG.info(\"Finished processing {}\", session);\n }\n }\n }", "class_method_signature": "SecurityServletFilter.doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "constructor": false, "full_signature": "@Override public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "identifier": "doFilter", "invocations": [ "getHeaderValue", "getHeaderValue", "getHeaderValueInt", "getHeaderValueBoolean", "defaultIfBlank", "getHeaderValue", "defaultIfBlank", "getHeaderValue", "initConfiguration", "isUserImpersonationEnabled", "isSecurityEnabled", "getLoginUser", "getUserName", "get", "isNotBlank", "debug", "getUserName", "doFilter", "getUserGroupInformation", "debug", "doAs", "getCause", "debug", "release", "error", "info" ], "modifiers": "@Override public", "parameters": "(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "return": "void", "signature": "void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_218
{ "fields": [ { "declarator": "parameters", "modifier": "private", "original_string": "private MultivaluedMap<String, String> parameters;", "type": "MultivaluedMap<String, String>", "var_name": "parameters" }, { "declarator": "parser", "modifier": "private", "original_string": "private HttpRequestParser parser;", "type": "HttpRequestParser", "var_name": "parser" }, { "declarator": "mockRequestHeaders", "modifier": "@Mock\n private", "original_string": "@Mock\n private ContainerRequest mockRequestHeaders;", "type": "ContainerRequest", "var_name": "mockRequestHeaders" }, { "declarator": "mockPluginConf", "modifier": "@Mock\n private", "original_string": "@Mock\n private PluginConf mockPluginConf;", "type": "PluginConf", "var_name": "mockPluginConf" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/HttpRequestParserTest.java", "identifier": "HttpRequestParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testWireFormatIsPresentAndFormatIsInferredToNothing() {\n parameters.putSingle(\"X-GP-FORMAT\", \"GPDBWritable\");\n parameters.putSingle(\"X-GP-OPTIONS-PROFILE\", \"foobar\");\n RequestContext context = parser.parseRequest(mockRequestHeaders, RequestType.FRAGMENTER);\n assertEquals(OutputFormat.GPDBWritable, context.getOutputFormat());\n assertNull(context.getFormat());\n }", "class_method_signature": "HttpRequestParserTest.testWireFormatIsPresentAndFormatIsInferredToNothing()", "constructor": false, "full_signature": "@Test public void testWireFormatIsPresentAndFormatIsInferredToNothing()", "identifier": "testWireFormatIsPresentAndFormatIsInferredToNothing", "invocations": [ "putSingle", "putSingle", "parseRequest", "assertEquals", "getOutputFormat", "assertNull", "getFormat" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testWireFormatIsPresentAndFormatIsInferredToNothing()", "testcase": true }
{ "fields": [ { "declarator": "TRUE_LCASE = \"true\"", "modifier": "private static final", "original_string": "private static final String TRUE_LCASE = \"true\";", "type": "String", "var_name": "TRUE_LCASE" }, { "declarator": "FALSE_LCASE = \"false\"", "modifier": "private static final", "original_string": "private static final String FALSE_LCASE = \"false\";", "type": "String", "var_name": "FALSE_LCASE" }, { "declarator": "LOG = LoggerFactory.getLogger(HttpRequestParser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpRequestParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "instance = new HttpRequestParser()", "modifier": "private static final", "original_string": "private static final HttpRequestParser instance = new HttpRequestParser();", "type": "HttpRequestParser", "var_name": "instance" }, { "declarator": "PROFILE_SCHEME = \"PROFILE-SCHEME\"", "modifier": "private static final", "original_string": "private static final String PROFILE_SCHEME = \"PROFILE-SCHEME\";", "type": "String", "var_name": "PROFILE_SCHEME" }, { "declarator": "pluginConf", "modifier": "private", "original_string": "private PluginConf pluginConf;", "type": "PluginConf", "var_name": "pluginConf" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/HttpRequestParser.java", "identifier": "HttpRequestParser", "interfaces": "implements RequestParser<HttpHeaders>", "methods": [ { "class_method_signature": "HttpRequestParser.HttpRequestParser()", "constructor": true, "full_signature": "public HttpRequestParser()", "identifier": "HttpRequestParser", "modifiers": "public", "parameters": "()", "return": "", "signature": " HttpRequestParser()", "testcase": false }, { "class_method_signature": "HttpRequestParser.HttpRequestParser(PluginConf pluginConf)", "constructor": true, "full_signature": " HttpRequestParser(PluginConf pluginConf)", "identifier": "HttpRequestParser", "modifiers": "", "parameters": "(PluginConf pluginConf)", "return": "", "signature": " HttpRequestParser(PluginConf pluginConf)", "testcase": false }, { "class_method_signature": "HttpRequestParser.getInstance()", "constructor": false, "full_signature": "public static HttpRequestParser getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "HttpRequestParser", "signature": "HttpRequestParser getInstance()", "testcase": false }, { "class_method_signature": "HttpRequestParser.protocolViolation(String property)", "constructor": false, "full_signature": "private static void protocolViolation(String property)", "identifier": "protocolViolation", "modifiers": "private static", "parameters": "(String property)", "return": "void", "signature": "void protocolViolation(String property)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseGreenplumCSV(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseGreenplumCSV(RequestMap params, RequestContext context)", "identifier": "parseGreenplumCSV", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseGreenplumCSV(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.addProfilePlugins(String profile, RequestMap params)", "constructor": false, "full_signature": "private void addProfilePlugins(String profile, RequestMap params)", "identifier": "addProfilePlugins", "modifiers": "private", "parameters": "(String profile, RequestMap params)", "return": "void", "signature": "void addProfilePlugins(String profile, RequestMap params)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseBooleanValue(String threadSafeStr)", "constructor": false, "full_signature": "private boolean parseBooleanValue(String threadSafeStr)", "identifier": "parseBooleanValue", "modifiers": "private", "parameters": "(String threadSafeStr)", "return": "boolean", "signature": "boolean parseBooleanValue(String threadSafeStr)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTupleDescription(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseTupleDescription(RequestMap params, RequestContext context)", "identifier": "parseTupleDescription", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseTupleDescription(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTypeMods(RequestMap params, int columnIndex)", "constructor": false, "full_signature": "private Integer[] parseTypeMods(RequestMap params, int columnIndex)", "identifier": "parseTypeMods", "modifiers": "private", "parameters": "(RequestMap params, int columnIndex)", "return": "Integer[]", "signature": "Integer[] parseTypeMods(RequestMap params, int columnIndex)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parsePositiveIntOrError(String s, String propName)", "constructor": false, "full_signature": "private int parsePositiveIntOrError(String s, String propName)", "identifier": "parsePositiveIntOrError", "modifiers": "private", "parameters": "(String s, String propName)", "return": "int", "signature": "int parsePositiveIntOrError(String s, String propName)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType) {\n\n RequestMap params = new RequestMap(request.getRequestHeaders());\n\n if (LOG.isDebugEnabled()) {\n // Logging only keys to prevent sensitive data to be logged\n LOG.debug(\"Parsing request parameters: \" + params.keySet());\n }\n\n // build new instance of RequestContext and fill it with parsed values\n RequestContext context = new RequestContext();\n\n // whether we are in a fragmenter, read_bridge, or write_bridge scenario\n context.setRequestType(requestType);\n\n // first of all, set profile and enrich parameters with information from specified profile\n String profile = params.removeUserProperty(\"PROFILE\");\n context.setProfile(profile);\n addProfilePlugins(profile, params);\n\n // Ext table uses system property FORMAT for wire serialization format\n String wireFormat = params.removeProperty(\"FORMAT\");\n context.setOutputFormat(OutputFormat.valueOf(wireFormat));\n\n // FDW uses user property FORMAT to indicate format of data\n String format = params.removeUserProperty(\"FORMAT\");\n format = StringUtils.isNotBlank(format) ? format : context.inferFormatName();\n context.setFormat(format);\n\n context.setAccessor(params.removeUserProperty(\"ACCESSOR\"));\n context.setAggType(EnumAggregationType.getAggregationType(params.removeOptionalProperty(\"AGG-TYPE\")));\n\n /*\n * Some resources don't require a fragment, hence the list can be empty.\n */\n String fragmentStr = params.removeOptionalProperty(\"DATA-FRAGMENT\");\n if (StringUtils.isNotBlank(fragmentStr)) {\n context.setDataFragment(Integer.parseInt(fragmentStr));\n }\n\n context.setDataSource(params.removeProperty(\"DATA-DIR\"));\n\n String filterString = params.removeOptionalProperty(\"FILTER\");\n String hasFilter = params.removeProperty(\"HAS-FILTER\");\n if (filterString != null) {\n context.setFilterString(filterString);\n } else if (\"1\".equals(hasFilter)) {\n LOG.info(\"Original query has filter, but it was not propagated to PXF\");\n }\n\n context.setFragmenter(params.removeUserProperty(\"FRAGMENTER\"));\n\n String fragmentIndexStr = params.removeOptionalProperty(\"FRAGMENT-INDEX\");\n if (StringUtils.isNotBlank(fragmentIndexStr)) {\n context.setFragmentIndex(Integer.parseInt(fragmentIndexStr));\n }\n\n String encodedFragmentMetadata = params.removeOptionalProperty(\"FRAGMENT-METADATA\");\n context.setFragmentMetadata(Utilities.parseBase64(encodedFragmentMetadata, \"Fragment metadata information\"));\n context.setHost(params.removeProperty(\"URL-HOST\"));\n context.setMetadata(params.removeUserProperty(\"METADATA\"));\n context.setPort(params.removeIntProperty(\"URL-PORT\"));\n context.setProfileScheme(params.removeUserProperty(PROFILE_SCHEME));\n context.setProtocol(params.removeUserProperty(\"PROTOCOL\"));\n context.setRemoteLogin(params.removeOptionalProperty(\"REMOTE-USER\"));\n context.setRemoteSecret(params.removeOptionalProperty(\"REMOTE-PASS\"));\n context.setResolver(params.removeUserProperty(\"RESOLVER\"));\n context.setSegmentId(params.removeIntProperty(\"SEGMENT-ID\"));\n context.setServerName(params.removeUserProperty(\"SERVER\"));\n\n // An optional CONFIG value specifies the name of the server\n // configuration directory, if not provided the config is the server name\n String config = params.removeUserProperty(\"CONFIG\");\n context.setConfig(StringUtils.isNotBlank(config) ? config : context.getServerName());\n\n String maxFrags = params.removeUserProperty(\"STATS-MAX-FRAGMENTS\");\n if (!StringUtils.isBlank(maxFrags)) {\n context.setStatsMaxFragments(Integer.parseInt(maxFrags));\n }\n\n String sampleRatioStr = params.removeUserProperty(\"STATS-SAMPLE-RATIO\");\n if (!StringUtils.isBlank(sampleRatioStr)) {\n context.setStatsSampleRatio(Float.parseFloat(sampleRatioStr));\n }\n\n context.setTotalSegments(params.removeIntProperty(\"SEGMENT-COUNT\"));\n context.setTransactionId(params.removeProperty(\"XID\"));\n\n // parse tuple description\n parseTupleDescription(params, context);\n\n if (context.getOutputFormat() == OutputFormat.TEXT) {\n // parse CSV format information\n parseGreenplumCSV(params, context);\n\n // Only single column tables support 'OFF' delimiter\n if (context.getTupleDescription().size() != 1 && context.getGreenplumCSV().getDelimiter() == null) {\n throw new IllegalArgumentException(String.format(\"using no delimiter is only possible for a single column table. %d columns found\", context.getTupleDescription().size()));\n }\n }\n\n context.setUser(params.removeProperty(\"USER\"));\n\n String encodedFragmentUserData = params.removeOptionalProperty(\"FRAGMENT-USER-DATA\");\n context.setUserData(Utilities.parseBase64(encodedFragmentUserData, \"Fragment user data\"));\n\n // Store alignment for global use as a system property\n System.setProperty(\"greenplum.alignment\", params.removeProperty(\"ALIGNMENT\"));\n\n Map<String, String> optionMappings = null;\n\n // prepare addition configuration properties if profile was specified\n if (StringUtils.isNotBlank(profile)) {\n optionMappings = pluginConf.getOptionMappings(profile);\n }\n\n // use empty map for convenience instead of null\n if (optionMappings == null) {\n optionMappings = Collections.emptyMap();\n }\n\n Map<String, String> additionalConfigProps = new HashMap<>();\n\n // Iterate over the remaining properties\n // we clone the keyset to prevent concurrent modification exceptions\n List<String> paramNames = new ArrayList<>(params.keySet());\n for (String param : paramNames) {\n if (StringUtils.startsWithIgnoreCase(param, RequestMap.USER_PROP_PREFIX)) {\n // Add all left-over user properties as options\n String optionName = param.toLowerCase().replace(RequestMap.USER_PROP_PREFIX_LOWERCASE, \"\");\n String optionValue = params.removeUserProperty(optionName);\n context.addOption(optionName, optionValue);\n LOG.debug(\"Added option {} to request context\", optionName);\n\n // lookup if the option should also be applied as a config property\n String propertyName = optionMappings.get(optionName);\n if (StringUtils.isNotBlank(propertyName)) {\n // if option has been provided by the user in the request, set the value\n // of the corresponding configuration property\n if (optionValue != null) {\n additionalConfigProps.put(propertyName, optionValue);\n // do not log property value as it might contain sensitive information\n LOG.debug(\"Added extra config property {} from option {}\", propertyName, optionName);\n }\n }\n } else if (StringUtils.startsWithIgnoreCase(param, RequestMap.PROP_PREFIX)) {\n // log debug for all left-over system properties\n LOG.debug(\"Unused property {}\", param);\n }\n }\n\n context.setAdditionalConfigProps(additionalConfigProps);\n context.setPluginConf(pluginConf);\n\n // Call the protocol handler for any protocol-specific logic handling\n if (StringUtils.isNotBlank(profile)) {\n String handlerClassName = pluginConf.getHandler(profile);\n if (StringUtils.isNotBlank(handlerClassName)) {\n Class<?> clazz;\n try {\n clazz = Class.forName(handlerClassName);\n ProtocolHandler handler = (ProtocolHandler) clazz.getDeclaredConstructor().newInstance();\n context.setFragmenter(handler.getFragmenterClassName(context));\n context.setAccessor(handler.getAccessorClassName(context));\n context.setResolver(handler.getResolverClassName(context));\n } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |\n InstantiationException | IllegalAccessException e) {\n throw new RuntimeException(String.format(\"Error when invoking handlerClass '%s' : %s\", handlerClassName, e), e);\n }\n }\n }\n\n // validate that the result has all required fields, and values are in valid ranges\n context.validate();\n\n return context;\n }", "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "invocations": [ "getRequestHeaders", "isDebugEnabled", "debug", "keySet", "setRequestType", "removeUserProperty", "setProfile", "addProfilePlugins", "removeProperty", "setOutputFormat", "valueOf", "removeUserProperty", "isNotBlank", "inferFormatName", "setFormat", "setAccessor", "removeUserProperty", "setAggType", "getAggregationType", "removeOptionalProperty", "removeOptionalProperty", "isNotBlank", "setDataFragment", "parseInt", "setDataSource", "removeProperty", "removeOptionalProperty", "removeProperty", "setFilterString", "equals", "info", "setFragmenter", "removeUserProperty", "removeOptionalProperty", "isNotBlank", "setFragmentIndex", "parseInt", "removeOptionalProperty", "setFragmentMetadata", "parseBase64", "setHost", "removeProperty", "setMetadata", "removeUserProperty", "setPort", "removeIntProperty", "setProfileScheme", "removeUserProperty", "setProtocol", "removeUserProperty", "setRemoteLogin", "removeOptionalProperty", "setRemoteSecret", "removeOptionalProperty", "setResolver", "removeUserProperty", "setSegmentId", "removeIntProperty", "setServerName", "removeUserProperty", "removeUserProperty", "setConfig", "isNotBlank", "getServerName", "removeUserProperty", "isBlank", "setStatsMaxFragments", "parseInt", "removeUserProperty", "isBlank", "setStatsSampleRatio", "parseFloat", "setTotalSegments", "removeIntProperty", "setTransactionId", "removeProperty", "parseTupleDescription", "getOutputFormat", "parseGreenplumCSV", "size", "getTupleDescription", "getDelimiter", "getGreenplumCSV", "format", "size", "getTupleDescription", "setUser", "removeProperty", "removeOptionalProperty", "setUserData", "parseBase64", "setProperty", "removeProperty", "isNotBlank", "getOptionMappings", "emptyMap", "keySet", "startsWithIgnoreCase", "replace", "toLowerCase", "removeUserProperty", "addOption", "debug", "get", "isNotBlank", "put", "debug", "startsWithIgnoreCase", "debug", "setAdditionalConfigProps", "setPluginConf", "isNotBlank", "getHandler", "isNotBlank", "forName", "newInstance", "getDeclaredConstructor", "setFragmenter", "getFragmenterClassName", "setAccessor", "getAccessorClassName", "setResolver", "getResolverClassName", "format", "validate" ], "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_82
{ "fields": [ { "declarator": "PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\"", "modifier": "private", "original_string": "private String PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_FRAGMENTER_CACHE" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/utilities/UtilitiesTest.java", "identifier": "UtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFragmenterCachePropertyAbsent() {\n System.clearProperty(PROPERTY_KEY_FRAGMENTER_CACHE);\n assertTrue(Utilities.isFragmenterCacheEnabled());\n }", "class_method_signature": "UtilitiesTest.testFragmenterCachePropertyAbsent()", "constructor": false, "full_signature": "@Test public void testFragmenterCachePropertyAbsent()", "identifier": "testFragmenterCachePropertyAbsent", "invocations": [ "clearProperty", "assertTrue", "isFragmenterCacheEnabled" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFragmenterCachePropertyAbsent()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(Utilities.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(Utilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_FRAGMENTER_CACHE" }, { "declarator": "PROHIBITED_CHARS = new char[]{'/', '\\\\', '.', ' ', ',', ';'}", "modifier": "private static final", "original_string": "private static final char[] PROHIBITED_CHARS = new char[]{'/', '\\\\', '.', ' ', ',', ';'};", "type": "char[]", "var_name": "PROHIBITED_CHARS" }, { "declarator": "HOSTS = new String[]{\"localhost\"}", "modifier": "private static final", "original_string": "private static final String[] HOSTS = new String[]{\"localhost\"};", "type": "String[]", "var_name": "HOSTS" }, { "declarator": "SCHEME_PATTERN = Pattern.compile(\"^((([^:/?#]+):)?//)?\")", "modifier": "public static final", "original_string": "public static final Pattern SCHEME_PATTERN = Pattern.compile(\"^((([^:/?#]+):)?//)?\");", "type": "Pattern", "var_name": "SCHEME_PATTERN" }, { "declarator": "NON_HOSTNAME_CHARACTERS = Pattern.compile(\"[:/?#]\")", "modifier": "public static final", "original_string": "public static final Pattern NON_HOSTNAME_CHARACTERS = Pattern.compile(\"[:/?#]\");", "type": "Pattern", "var_name": "NON_HOSTNAME_CHARACTERS" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/utilities/Utilities.java", "identifier": "Utilities", "interfaces": "", "methods": [ { "class_method_signature": "Utilities.parseBase64(String encoded, String paramName)", "constructor": false, "full_signature": "public static byte[] parseBase64(String encoded, String paramName)", "identifier": "parseBase64", "modifiers": "public static", "parameters": "(String encoded, String paramName)", "return": "byte[]", "signature": "byte[] parseBase64(String encoded, String paramName)", "testcase": false }, { "class_method_signature": "Utilities.isValidDirectoryName(String name)", "constructor": false, "full_signature": "public static boolean isValidDirectoryName(String name)", "identifier": "isValidDirectoryName", "modifiers": "public static", "parameters": "(String name)", "return": "boolean", "signature": "boolean isValidDirectoryName(String name)", "testcase": false }, { "class_method_signature": "Utilities.isValidRestrictedDirectoryName(String name)", "constructor": false, "full_signature": "public static boolean isValidRestrictedDirectoryName(String name)", "identifier": "isValidRestrictedDirectoryName", "modifiers": "public static", "parameters": "(String name)", "return": "boolean", "signature": "boolean isValidRestrictedDirectoryName(String name)", "testcase": false }, { "class_method_signature": "Utilities.isValidRestrictedDirectoryName(String name, boolean checkForProhibitedChars)", "constructor": false, "full_signature": "private static boolean isValidRestrictedDirectoryName(String name, boolean checkForProhibitedChars)", "identifier": "isValidRestrictedDirectoryName", "modifiers": "private static", "parameters": "(String name, boolean checkForProhibitedChars)", "return": "boolean", "signature": "boolean isValidRestrictedDirectoryName(String name, boolean checkForProhibitedChars)", "testcase": false }, { "class_method_signature": "Utilities.createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "constructor": false, "full_signature": "public static Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "identifier": "createAnyInstance", "modifiers": "public static", "parameters": "(Class<?> confClass,\n String className, RequestContext metaData)", "return": "Object", "signature": "Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "testcase": false }, { "class_method_signature": "Utilities.createAnyInstance(String className)", "constructor": false, "full_signature": "public static Object createAnyInstance(String className)", "identifier": "createAnyInstance", "modifiers": "public static", "parameters": "(String className)", "return": "Object", "signature": "Object createAnyInstance(String className)", "testcase": false }, { "class_method_signature": "Utilities.instantiate(Constructor<?> con, Object... args)", "constructor": false, "full_signature": "private static Object instantiate(Constructor<?> con, Object... args)", "identifier": "instantiate", "modifiers": "private static", "parameters": "(Constructor<?> con, Object... args)", "return": "Object", "signature": "Object instantiate(Constructor<?> con, Object... args)", "testcase": false }, { "class_method_signature": "Utilities.byteArrayToOctalString(byte[] bytes, StringBuilder sb)", "constructor": false, "full_signature": "public static void byteArrayToOctalString(byte[] bytes, StringBuilder sb)", "identifier": "byteArrayToOctalString", "modifiers": "public static", "parameters": "(byte[] bytes, StringBuilder sb)", "return": "void", "signature": "void byteArrayToOctalString(byte[] bytes, StringBuilder sb)", "testcase": false }, { "class_method_signature": "Utilities.maskNonPrintables(String input)", "constructor": false, "full_signature": "public static String maskNonPrintables(String input)", "identifier": "maskNonPrintables", "modifiers": "public static", "parameters": "(String input)", "return": "String", "signature": "String maskNonPrintables(String input)", "testcase": false }, { "class_method_signature": "Utilities.parseFragmentMetadata(RequestContext context)", "constructor": false, "full_signature": "public static FragmentMetadata parseFragmentMetadata(RequestContext context)", "identifier": "parseFragmentMetadata", "modifiers": "public static", "parameters": "(RequestContext context)", "return": "FragmentMetadata", "signature": "FragmentMetadata parseFragmentMetadata(RequestContext context)", "testcase": false }, { "class_method_signature": "Utilities.aggregateOptimizationsSupported(RequestContext requestContext)", "constructor": false, "full_signature": "public static boolean aggregateOptimizationsSupported(RequestContext requestContext)", "identifier": "aggregateOptimizationsSupported", "modifiers": "public static", "parameters": "(RequestContext requestContext)", "return": "boolean", "signature": "boolean aggregateOptimizationsSupported(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "Utilities.implementsInterface(String className, Class<?> iface)", "constructor": false, "full_signature": "public static boolean implementsInterface(String className, Class<?> iface)", "identifier": "implementsInterface", "modifiers": "public static", "parameters": "(String className, Class<?> iface)", "return": "boolean", "signature": "boolean implementsInterface(String className, Class<?> iface)", "testcase": false }, { "class_method_signature": "Utilities.isFragmenterCacheEnabled()", "constructor": false, "full_signature": "public static boolean isFragmenterCacheEnabled()", "identifier": "isFragmenterCacheEnabled", "modifiers": "public static", "parameters": "()", "return": "boolean", "signature": "boolean isFragmenterCacheEnabled()", "testcase": false }, { "class_method_signature": "Utilities.absoluteDataPath(String dataSource)", "constructor": false, "full_signature": "public static String absoluteDataPath(String dataSource)", "identifier": "absoluteDataPath", "modifiers": "public static", "parameters": "(String dataSource)", "return": "String", "signature": "String absoluteDataPath(String dataSource)", "testcase": false }, { "class_method_signature": "Utilities.isSecurityEnabled(Configuration configuration)", "constructor": false, "full_signature": "public static boolean isSecurityEnabled(Configuration configuration)", "identifier": "isSecurityEnabled", "modifiers": "public static", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isSecurityEnabled(Configuration configuration)", "testcase": false }, { "class_method_signature": "Utilities.rightTrimWhiteSpace(String s)", "constructor": false, "full_signature": "public static String rightTrimWhiteSpace(String s)", "identifier": "rightTrimWhiteSpace", "modifiers": "public static", "parameters": "(String s)", "return": "String", "signature": "String rightTrimWhiteSpace(String s)", "testcase": false }, { "class_method_signature": "Utilities.getHost(String uri)", "constructor": false, "full_signature": "public static String getHost(String uri)", "identifier": "getHost", "modifiers": "public static", "parameters": "(String uri)", "return": "String", "signature": "String getHost(String uri)", "testcase": false } ], "superclass": "" }
{ "body": "public static boolean isFragmenterCacheEnabled() {\n return !StringUtils.equalsIgnoreCase(System.getProperty(PROPERTY_KEY_FRAGMENTER_CACHE, \"true\"), \"false\");\n }", "class_method_signature": "Utilities.isFragmenterCacheEnabled()", "constructor": false, "full_signature": "public static boolean isFragmenterCacheEnabled()", "identifier": "isFragmenterCacheEnabled", "invocations": [ "equalsIgnoreCase", "getProperty" ], "modifiers": "public static", "parameters": "()", "return": "boolean", "signature": "boolean isFragmenterCacheEnabled()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_131
{ "fields": [ { "declarator": "MINUTES = 60 * 1000L", "modifier": "private static final", "original_string": "private static final long MINUTES = 60 * 1000L;", "type": "long", "var_name": "MINUTES" }, { "declarator": "provider = null", "modifier": "private", "original_string": "private UGIProvider provider = null;", "type": "UGIProvider", "var_name": "provider" }, { "declarator": "session = null", "modifier": "private", "original_string": "private SessionId session = null;", "type": "SessionId", "var_name": "session" }, { "declarator": "cache = null", "modifier": "private", "original_string": "private UGICache cache = null;", "type": "UGICache", "var_name": "cache" }, { "declarator": "fakeTicker", "modifier": "private", "original_string": "private FakeTicker fakeTicker;", "type": "FakeTicker", "var_name": "fakeTicker" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/UGICacheTest.java", "identifier": "UGICacheTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getTwoUGIsWithDifferentUsers() throws Exception {\n SessionId otherSession = new SessionId(0, \"txn-id\", \"different-user\", \"default\", false, UserGroupInformation.getLoginUser());\n UserGroupInformation ugi1 = cache.getUserGroupInformation(session, false);\n UserGroupInformation ugi2 = cache.getUserGroupInformation(otherSession, false);\n assertNotEquals(ugi1, ugi2);\n verify(provider, times(1)).createRemoteUser(eq(\"the-user\"), any(SessionId.class));\n verify(provider, times(1)).createRemoteUser(eq(\"different-user\"), any(SessionId.class));\n assertCacheSize(2);\n assertStillInCache(session, ugi1);\n assertStillInCache(otherSession, ugi2);\n }", "class_method_signature": "UGICacheTest.getTwoUGIsWithDifferentUsers()", "constructor": false, "full_signature": "@Test public void getTwoUGIsWithDifferentUsers()", "identifier": "getTwoUGIsWithDifferentUsers", "invocations": [ "getLoginUser", "getUserGroupInformation", "getUserGroupInformation", "assertNotEquals", "createRemoteUser", "verify", "times", "eq", "any", "createRemoteUser", "verify", "times", "eq", "any", "assertCacheSize", "assertStillInCache", "assertStillInCache" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getTwoUGIsWithDifferentUsers()", "testcase": true }
{ "fields": [ { "declarator": "NANOS_PER_MILLIS = 1000000", "modifier": "static final", "original_string": "static final int NANOS_PER_MILLIS = 1000000;", "type": "int", "var_name": "NANOS_PER_MILLIS" }, { "declarator": "UGI_CACHE_EXPIRY = 15 * 60 * 1000L", "modifier": "static final", "original_string": "static final long UGI_CACHE_EXPIRY = 15 * 60 * 1000L;", "type": "long", "var_name": "UGI_CACHE_EXPIRY" }, { "declarator": "LOG = LoggerFactory.getLogger(UGICache.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(UGICache.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "cache = new ConcurrentHashMap<>()", "modifier": "private final", "original_string": "private final Map<SessionId, Entry> cache = new ConcurrentHashMap<>();", "type": "Map<SessionId, Entry>", "var_name": "cache" }, { "declarator": "expirationQueueMap = new HashMap<>()", "modifier": "private final", "original_string": "private final Map<Integer, DelayQueue<Entry>> expirationQueueMap = new HashMap<>();", "type": "Map<Integer, DelayQueue<Entry>>", "var_name": "expirationQueueMap" }, { "declarator": "ugiProvider", "modifier": "private final", "original_string": "private final UGIProvider ugiProvider;", "type": "UGIProvider", "var_name": "ugiProvider" }, { "declarator": "ticker", "modifier": "private final", "original_string": "private final Ticker ticker;", "type": "Ticker", "var_name": "ticker" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/UGICache.java", "identifier": "UGICache", "interfaces": "", "methods": [ { "class_method_signature": "UGICache.UGICache(UGIProvider provider, Ticker ticker)", "constructor": true, "full_signature": " UGICache(UGIProvider provider, Ticker ticker)", "identifier": "UGICache", "modifiers": "", "parameters": "(UGIProvider provider, Ticker ticker)", "return": "", "signature": " UGICache(UGIProvider provider, Ticker ticker)", "testcase": false }, { "class_method_signature": "UGICache.UGICache()", "constructor": true, "full_signature": "public UGICache()", "identifier": "UGICache", "modifiers": "public", "parameters": "()", "return": "", "signature": " UGICache()", "testcase": false }, { "class_method_signature": "UGICache.getUserGroupInformation(SessionId session, boolean isProxyUser)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "identifier": "getUserGroupInformation", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean isProxyUser)", "return": "UserGroupInformation", "signature": "UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "testcase": false }, { "class_method_signature": "UGICache.release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public void release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "identifier": "release", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean cleanImmediatelyIfNoRefs)", "return": "void", "signature": "void release(SessionId session, boolean cleanImmediatelyIfNoRefs)", "testcase": false }, { "class_method_signature": "UGICache.size()", "constructor": false, "full_signature": " int size()", "identifier": "size", "modifiers": "", "parameters": "()", "return": "int", "signature": "int size()", "testcase": false }, { "class_method_signature": "UGICache.allQueuesSize()", "constructor": false, "full_signature": " int allQueuesSize()", "identifier": "allQueuesSize", "modifiers": "", "parameters": "()", "return": "int", "signature": "int allQueuesSize()", "testcase": false }, { "class_method_signature": "UGICache.contains(SessionId session)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") boolean contains(SessionId session)", "identifier": "contains", "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\")", "parameters": "(SessionId session)", "return": "boolean", "signature": "boolean contains(SessionId session)", "testcase": false }, { "class_method_signature": "UGICache.getExpirationQueue(Integer segmentId)", "constructor": false, "full_signature": "private DelayQueue<Entry> getExpirationQueue(Integer segmentId)", "identifier": "getExpirationQueue", "modifiers": "private", "parameters": "(Integer segmentId)", "return": "DelayQueue<Entry>", "signature": "DelayQueue<Entry> getExpirationQueue(Integer segmentId)", "testcase": false }, { "class_method_signature": "UGICache.cleanup(DelayQueue<Entry> expirationQueue)", "constructor": false, "full_signature": "private void cleanup(DelayQueue<Entry> expirationQueue)", "identifier": "cleanup", "modifiers": "private", "parameters": "(DelayQueue<Entry> expirationQueue)", "return": "void", "signature": "void cleanup(DelayQueue<Entry> expirationQueue)", "testcase": false }, { "class_method_signature": "UGICache.closeUGI(Entry expiredUGI)", "constructor": false, "full_signature": "private void closeUGI(Entry expiredUGI)", "identifier": "closeUGI", "modifiers": "private", "parameters": "(Entry expiredUGI)", "return": "void", "signature": "void closeUGI(Entry expiredUGI)", "testcase": false } ], "superclass": "" }
{ "body": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\")\n public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser) throws IOException {\n Integer segmentId = session.getSegmentId();\n String user = session.getUser();\n DelayQueue<Entry> delayQueue = getExpirationQueue(segmentId);\n synchronized (delayQueue) {\n // Use the opportunity to cleanup any expired entries\n cleanup(delayQueue);\n Entry entry = cache.get(session);\n if (entry == null) {\n\n UserGroupInformation ugi;\n if (isProxyUser) {\n LOG.debug(\"{} Creating proxy user = {}\", session, user);\n ugi = ugiProvider.createProxyUGI(user, session.getLoginUser());\n } else {\n LOG.debug(\"{} Creating remote user = {}\", session, user);\n ugi = ugiProvider.createRemoteUser(user, session);\n }\n entry = new Entry(ticker, ugi, session);\n delayQueue.offer(entry);\n cache.put(session, entry);\n }\n entry.incrementRefCount();\n return entry.getUGI();\n }\n }", "class_method_signature": "UGICache.getUserGroupInformation(SessionId session, boolean isProxyUser)", "constructor": false, "full_signature": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "identifier": "getUserGroupInformation", "invocations": [ "getSegmentId", "getUser", "getExpirationQueue", "cleanup", "get", "debug", "createProxyUGI", "getLoginUser", "debug", "createRemoteUser", "offer", "put", "incrementRefCount", "getUGI" ], "modifiers": "@SuppressWarnings(\"SynchronizationOnLocalVariableOrMethodParameter\") public", "parameters": "(SessionId session, boolean isProxyUser)", "return": "UserGroupInformation", "signature": "UserGroupInformation getUserGroupInformation(SessionId session, boolean isProxyUser)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_146
{ "fields": [ { "declarator": "UN_SUPPORTED_TYPE = -1", "modifier": "private static final", "original_string": "private static final int UN_SUPPORTED_TYPE = -1;", "type": "int", "var_name": "UN_SUPPORTED_TYPE" }, { "declarator": "output = null", "modifier": "private", "original_string": "private GPDBWritable output = null;", "type": "GPDBWritable", "var_name": "output" }, { "declarator": "dos = new DataOutputToBytes()", "modifier": "private", "original_string": "private DataOutputToBytes dos = new DataOutputToBytes();", "type": "DataOutputToBytes", "var_name": "dos" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/BridgeOutputBuilderTest.java", "identifier": "BridgeOutputBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFillOneGPDBWritableField() throws Exception {\n RequestContext context = new RequestContext();\n addColumn(context, 0, DataType.INTEGER, \"col0\");\n BridgeOutputBuilder builder = makeBuilder(context);\n output = builder.makeGPDBWritableOutput();\n\n OneField unSupportedField = new OneField(UN_SUPPORTED_TYPE, (byte) 0);\n try {\n builder.fillOneGPDBWritableField(unSupportedField, 0);\n fail(\"Unsupported data type should throw exception\");\n } catch (UnsupportedOperationException e) {\n assertEquals(e.getMessage(),\n \"Byte is not supported for GPDB conversion\");\n }\n }", "class_method_signature": "BridgeOutputBuilderTest.testFillOneGPDBWritableField()", "constructor": false, "full_signature": "@Test public void testFillOneGPDBWritableField()", "identifier": "testFillOneGPDBWritableField", "invocations": [ "addColumn", "makeBuilder", "makeGPDBWritableOutput", "fillOneGPDBWritableField", "fail", "assertEquals", "getMessage" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFillOneGPDBWritableField()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(BridgeOutputBuilder.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(BridgeOutputBuilder.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "DELIM = 10", "modifier": "private static final", "original_string": "private static final byte DELIM = 10;", "type": "byte", "var_name": "DELIM" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "output = null", "modifier": "private", "original_string": "private Writable output = null;", "type": "Writable", "var_name": "output" }, { "declarator": "outputList", "modifier": "private", "original_string": "private LinkedList<Writable> outputList;", "type": "LinkedList<Writable>", "var_name": "outputList" }, { "declarator": "partialLine = null", "modifier": "private", "original_string": "private Writable partialLine = null;", "type": "Writable", "var_name": "partialLine" }, { "declarator": "errorRecord = null", "modifier": "private", "original_string": "private GPDBWritable errorRecord = null;", "type": "GPDBWritable", "var_name": "errorRecord" }, { "declarator": "schema", "modifier": "private", "original_string": "private int[] schema;", "type": "int[]", "var_name": "schema" }, { "declarator": "colNames", "modifier": "private", "original_string": "private String[] colNames;", "type": "String[]", "var_name": "colNames" }, { "declarator": "samplingEnabled", "modifier": "private", "original_string": "private boolean samplingEnabled;", "type": "boolean", "var_name": "samplingEnabled" }, { "declarator": "isPartialLine = false", "modifier": "private", "original_string": "private boolean isPartialLine = false;", "type": "boolean", "var_name": "isPartialLine" }, { "declarator": "greenplumCSV", "modifier": "private", "original_string": "private GreenplumCSV greenplumCSV;", "type": "GreenplumCSV", "var_name": "greenplumCSV" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/BridgeOutputBuilder.java", "identifier": "BridgeOutputBuilder", "interfaces": "", "methods": [ { "class_method_signature": "BridgeOutputBuilder.BridgeOutputBuilder(RequestContext context)", "constructor": true, "full_signature": "public BridgeOutputBuilder(RequestContext context)", "identifier": "BridgeOutputBuilder", "modifiers": "public", "parameters": "(RequestContext context)", "return": "", "signature": " BridgeOutputBuilder(RequestContext context)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.makeErrorRecord()", "constructor": false, "full_signature": " void makeErrorRecord()", "identifier": "makeErrorRecord", "modifiers": "", "parameters": "()", "return": "void", "signature": "void makeErrorRecord()", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.getErrorOutput(Exception ex)", "constructor": false, "full_signature": "public Writable getErrorOutput(Exception ex)", "identifier": "getErrorOutput", "modifiers": "public", "parameters": "(Exception ex)", "return": "Writable", "signature": "Writable getErrorOutput(Exception ex)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.makeOutput(List<OneField> recFields)", "constructor": false, "full_signature": "public LinkedList<Writable> makeOutput(List<OneField> recFields)", "identifier": "makeOutput", "modifiers": "public", "parameters": "(List<OneField> recFields)", "return": "LinkedList<Writable>", "signature": "LinkedList<Writable> makeOutput(List<OneField> recFields)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.makeVectorizedOutput(List<List<OneField>> recordsBatch)", "constructor": false, "full_signature": "public LinkedList<Writable> makeVectorizedOutput(List<List<OneField>> recordsBatch)", "identifier": "makeVectorizedOutput", "modifiers": "public", "parameters": "(List<List<OneField>> recordsBatch)", "return": "LinkedList<Writable>", "signature": "LinkedList<Writable> makeVectorizedOutput(List<List<OneField>> recordsBatch)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.getPartialLine()", "constructor": false, "full_signature": "public Writable getPartialLine()", "identifier": "getPartialLine", "modifiers": "public", "parameters": "()", "return": "Writable", "signature": "Writable getPartialLine()", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.makeGPDBWritableOutput()", "constructor": false, "full_signature": " GPDBWritable makeGPDBWritableOutput()", "identifier": "makeGPDBWritableOutput", "modifiers": "", "parameters": "()", "return": "GPDBWritable", "signature": "GPDBWritable makeGPDBWritableOutput()", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.fillOutputRecord(List<OneField> recFields)", "constructor": false, "full_signature": " void fillOutputRecord(List<OneField> recFields)", "identifier": "fillOutputRecord", "modifiers": "", "parameters": "(List<OneField> recFields)", "return": "void", "signature": "void fillOutputRecord(List<OneField> recFields)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.fillGPDBWritable(List<OneField> recFields)", "constructor": false, "full_signature": " void fillGPDBWritable(List<OneField> recFields)", "identifier": "fillGPDBWritable", "modifiers": "", "parameters": "(List<OneField> recFields)", "return": "void", "signature": "void fillGPDBWritable(List<OneField> recFields)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.isStringType(DataType type)", "constructor": false, "full_signature": " boolean isStringType(DataType type)", "identifier": "isStringType", "modifiers": "", "parameters": "(DataType type)", "return": "boolean", "signature": "boolean isStringType(DataType type)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.isTypeInSchema(int recType, int schemaType)", "constructor": false, "full_signature": " boolean isTypeInSchema(int recType, int schemaType)", "identifier": "isTypeInSchema", "modifiers": "", "parameters": "(int recType, int schemaType)", "return": "boolean", "signature": "boolean isTypeInSchema(int recType, int schemaType)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.fillText(List<OneField> recFields)", "constructor": false, "full_signature": " void fillText(List<OneField> recFields)", "identifier": "fillText", "modifiers": "", "parameters": "(List<OneField> recFields)", "return": "void", "signature": "void fillText(List<OneField> recFields)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.convertTextDataToLines(byte[] val)", "constructor": false, "full_signature": " void convertTextDataToLines(byte[] val)", "identifier": "convertTextDataToLines", "modifiers": "", "parameters": "(byte[] val)", "return": "void", "signature": "void convertTextDataToLines(byte[] val)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.fillOneGPDBWritableField(OneField oneField, int colIdx)", "constructor": false, "full_signature": " void fillOneGPDBWritableField(OneField oneField, int colIdx)", "identifier": "fillOneGPDBWritableField", "modifiers": "", "parameters": "(OneField oneField, int colIdx)", "return": "void", "signature": "void fillOneGPDBWritableField(OneField oneField, int colIdx)", "testcase": false }, { "class_method_signature": "BridgeOutputBuilder.fieldListToCSVString(List<OneField> fields)", "constructor": false, "full_signature": "private String fieldListToCSVString(List<OneField> fields)", "identifier": "fieldListToCSVString", "modifiers": "private", "parameters": "(List<OneField> fields)", "return": "String", "signature": "String fieldListToCSVString(List<OneField> fields)", "testcase": false } ], "superclass": "" }
{ "body": "void fillOneGPDBWritableField(OneField oneField, int colIdx)\n throws BadRecordException {\n int type = oneField.type;\n Object val = oneField.val;\n GPDBWritable gpdbOutput = (GPDBWritable) output;\n try {\n switch (DataType.get(type)) {\n case INTEGER:\n gpdbOutput.setInt(colIdx, (Integer) val);\n break;\n case FLOAT8:\n gpdbOutput.setDouble(colIdx, (Double) val);\n break;\n case REAL:\n gpdbOutput.setFloat(colIdx, (Float) val);\n break;\n case BIGINT:\n gpdbOutput.setLong(colIdx, (Long) val);\n break;\n case SMALLINT:\n gpdbOutput.setShort(colIdx, (Short) val);\n break;\n case BOOLEAN:\n gpdbOutput.setBoolean(colIdx, (Boolean) val);\n break;\n case BYTEA:\n byte[] bts = null;\n if (val != null) {\n int length = Array.getLength(val);\n bts = new byte[length];\n for (int j = 0; j < length; j++) {\n bts[j] = Array.getByte(val, j);\n }\n }\n gpdbOutput.setBytes(colIdx, bts);\n break;\n case VARCHAR:\n case BPCHAR:\n case TEXT:\n case NUMERIC:\n case TIMESTAMP:\n case DATE:\n gpdbOutput.setString(colIdx,\n ObjectUtils.toString(val, null));\n break;\n default:\n String valClassName = (val != null) ? val.getClass().getSimpleName()\n : null;\n throw new UnsupportedOperationException(valClassName\n + \" is not supported for GPDB conversion\");\n }\n } catch (GPDBWritable.TypeMismatchException e) {\n throw new BadRecordException(e);\n }\n }", "class_method_signature": "BridgeOutputBuilder.fillOneGPDBWritableField(OneField oneField, int colIdx)", "constructor": false, "full_signature": " void fillOneGPDBWritableField(OneField oneField, int colIdx)", "identifier": "fillOneGPDBWritableField", "invocations": [ "get", "setInt", "setDouble", "setFloat", "setLong", "setShort", "setBoolean", "getLength", "getByte", "setBytes", "setString", "toString", "getSimpleName", "getClass" ], "modifiers": "", "parameters": "(OneField oneField, int colIdx)", "return": "void", "signature": "void fillOneGPDBWritableField(OneField oneField, int colIdx)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_4
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "factory", "modifier": "private", "original_string": "private BaseConfigurationFactory factory;", "type": "BaseConfigurationFactory", "var_name": "factory" }, { "declarator": "additionalProperties", "modifier": "private", "original_string": "private Map<String, String> additionalProperties;", "type": "Map<String, String>", "var_name": "additionalProperties" }, { "declarator": "mockServersDirectory", "modifier": "private", "original_string": "private File mockServersDirectory;", "type": "File", "var_name": "mockServersDirectory" }, { "declarator": "serversDirectory", "modifier": "private", "original_string": "private File serversDirectory;", "type": "File", "var_name": "serversDirectory" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/BaseConfigurationFactoryTest.java", "identifier": "BaseConfigurationFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testConfigurationsLoadedFromMultipleFilesForDefaultServer() {\n Configuration configuration = factory.initConfiguration(\"default\", \"default\", \"dummy\", null);\n\n assertEquals(\"blue\", configuration.get(\"test.blue\"));\n assertEquals(\"red\", configuration.get(\"test.red\"));\n\n // Should return null because the file name does not end in -site.xml\n assertNull(configuration.get(\"test.green\"));\n\n assertEquals(\"bluevaluefromuser\", configuration.get(\"test.blue.key\"));\n assertEquals(\"redvaluefromuser\", configuration.get(\"test.red.key\"));\n assertEquals(\"uservalue\", configuration.get(\"test.user.key\"));\n }", "class_method_signature": "BaseConfigurationFactoryTest.testConfigurationsLoadedFromMultipleFilesForDefaultServer()", "constructor": false, "full_signature": "@Test public void testConfigurationsLoadedFromMultipleFilesForDefaultServer()", "identifier": "testConfigurationsLoadedFromMultipleFilesForDefaultServer", "invocations": [ "initConfiguration", "assertEquals", "get", "assertEquals", "get", "assertNull", "get", "assertEquals", "get", "assertEquals", "get", "assertEquals", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testConfigurationsLoadedFromMultipleFilesForDefaultServer()", "testcase": true }
{ "fields": [ { "declarator": "instance = new BaseConfigurationFactory()", "modifier": "private static final", "original_string": "private static final BaseConfigurationFactory instance = new BaseConfigurationFactory();", "type": "BaseConfigurationFactory", "var_name": "instance" }, { "declarator": "LOG = LoggerFactory.getLogger(this.getClass())", "modifier": "protected final", "original_string": "protected final Logger LOG = LoggerFactory.getLogger(this.getClass());", "type": "Logger", "var_name": "LOG" }, { "declarator": "serversConfigDirectory", "modifier": "private final", "original_string": "private final File serversConfigDirectory;", "type": "File", "var_name": "serversConfigDirectory" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/BaseConfigurationFactory.java", "identifier": "BaseConfigurationFactory", "interfaces": "implements ConfigurationFactory", "methods": [ { "class_method_signature": "BaseConfigurationFactory.BaseConfigurationFactory()", "constructor": true, "full_signature": "public BaseConfigurationFactory()", "identifier": "BaseConfigurationFactory", "modifiers": "public", "parameters": "()", "return": "", "signature": " BaseConfigurationFactory()", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.BaseConfigurationFactory(File serversConfigDirectory)", "constructor": true, "full_signature": " BaseConfigurationFactory(File serversConfigDirectory)", "identifier": "BaseConfigurationFactory", "modifiers": "", "parameters": "(File serversConfigDirectory)", "return": "", "signature": " BaseConfigurationFactory(File serversConfigDirectory)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.getInstance()", "constructor": false, "full_signature": "public static BaseConfigurationFactory getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "BaseConfigurationFactory", "signature": "BaseConfigurationFactory getInstance()", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "constructor": false, "full_signature": "@Override public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "identifier": "initConfiguration", "modifiers": "@Override public", "parameters": "(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "return": "Configuration", "signature": "Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.processServerResources(Configuration configuration, String serverName, File directory)", "constructor": false, "full_signature": "private void processServerResources(Configuration configuration, String serverName, File directory)", "identifier": "processServerResources", "modifiers": "private", "parameters": "(Configuration configuration, String serverName, File directory)", "return": "void", "signature": "void processServerResources(Configuration configuration, String serverName, File directory)", "testcase": false }, { "class_method_signature": "BaseConfigurationFactory.processUserResource(Configuration configuration, String serverName, String userName, File directory)", "constructor": false, "full_signature": "private void processUserResource(Configuration configuration, String serverName, String userName, File directory)", "identifier": "processUserResource", "modifiers": "private", "parameters": "(Configuration configuration, String serverName, String userName, File directory)", "return": "void", "signature": "void processUserResource(Configuration configuration, String serverName, String userName, File directory)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties) {\n // start with built-in Hadoop configuration that loads core-site.xml\n LOG.debug(\"Initializing configuration for server {}\", serverName);\n Configuration configuration = new Configuration();\n // while implementing multiple kerberized support we noticed that non-kerberized hadoop\n // access was trying to use SASL-client authentication. Setting the fallback to simple auth\n // allows us to still access non-kerberized hadoop clusters when there exists at least one\n // kerberized hadoop cluster. The root cause is that UGI has static fields and many hadoop\n // libraries depend on the state of the UGI\n // allow using SIMPLE auth for non-Kerberized HCFS access by SASL-enabled IPC client\n // that is created due to the fact that it uses UGI.isSecurityEnabled\n // and will try to use SASL if there is at least one Kerberized Hadoop cluster\n configuration.set(CommonConfigurationKeys.IPC_CLIENT_FALLBACK_TO_SIMPLE_AUTH_ALLOWED_KEY, \"true\");\n\n // set synthetic property pxf.session.user so that is can be used in config files for interpolation in other properties\n // for example in JDBC when setting session authorization from a proxy user to the end-user\n configuration.set(PXF_SESSION_USER_PROPERTY, userName);\n\n File[] serverDirectories = null;\n Path p = Paths.get(configDirectory);\n\n if (p.isAbsolute()) {\n File f = p.toFile();\n if (f.exists() && f.isDirectory() && f.canRead()) {\n serverDirectories = new File[]{f};\n }\n } else {\n serverDirectories = serversConfigDirectory\n .listFiles(f ->\n f.isDirectory() &&\n f.canRead() &&\n StringUtils.equalsIgnoreCase(configDirectory, f.getName()));\n }\n\n if (ArrayUtils.isEmpty(serverDirectories)) {\n LOG.debug(\"Directory {}{}{} does not exist or cannot be read by PXF, no configuration resources are added for server {}\",\n serversConfigDirectory, File.separator, configDirectory, serverName);\n } else if (serverDirectories.length > 1) {\n throw new IllegalStateException(String.format(\n \"Multiple directories found for server %s. Server directories are expected to be case-insensitive.\", serverName\n ));\n } else {\n // add all site files as URL resources to the configuration, no resources will be added from the classpath\n LOG.debug(\"Using directory {} for server {} configuration\", serverDirectories[0], serverName);\n processServerResources(configuration, serverName, serverDirectories[0]);\n }\n\n // add additional properties, if provided\n if (additionalProperties != null) {\n LOG.debug(\"Adding {} additional properties to configuration for server {}\", additionalProperties.size(), serverName);\n additionalProperties.forEach(configuration::set);\n }\n\n // add user configuration\n if (!ArrayUtils.isEmpty(serverDirectories)) {\n processUserResource(configuration, serverName, userName, serverDirectories[0]);\n }\n\n try {\n // We need to set the restrict system properties to false so\n // variables in the configuration get replaced by system property\n // values\n configuration.setRestrictSystemProps(false);\n } catch (NoSuchMethodError e) {\n // Expected exception for MapR\n }\n\n return configuration;\n }", "class_method_signature": "BaseConfigurationFactory.initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "constructor": false, "full_signature": "@Override public Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "identifier": "initConfiguration", "invocations": [ "debug", "set", "set", "get", "isAbsolute", "toFile", "exists", "isDirectory", "canRead", "listFiles", "isDirectory", "canRead", "equalsIgnoreCase", "getName", "isEmpty", "debug", "format", "debug", "processServerResources", "debug", "size", "forEach", "isEmpty", "processUserResource", "setRestrictSystemProps" ], "modifiers": "@Override public", "parameters": "(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "return": "Configuration", "signature": "Configuration initConfiguration(String configDirectory, String serverName, String userName, Map<String, String> additionalProperties)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_280
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "accessor", "modifier": "private", "original_string": "private QuotedLineBreakAccessor accessor;", "type": "QuotedLineBreakAccessor", "var_name": "accessor" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/QuotedLineBreakAccessorTest.java", "identifier": "QuotedLineBreakAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFileAsRowFailsWithMoreThanOneColumn() {\n expectedException.expect(IllegalArgumentException.class);\n expectedException.expectMessage(\"the FILE_AS_ROW property \" +\n \"only supports tables with a single column in the table \" +\n \"definition. 2 columns were provided\");\n\n context.addOption(\"FILE_AS_ROW\", \"true\");\n // Add two columns\n context.getTupleDescription().add(new ColumnDescriptor(\"col1\", 1, 1, \"TEXT\", null));\n context.getTupleDescription().add(new ColumnDescriptor(\"col2\", 1, 2, \"TEXT\", null));\n accessor.initialize(context);\n }", "class_method_signature": "QuotedLineBreakAccessorTest.testFileAsRowFailsWithMoreThanOneColumn()", "constructor": false, "full_signature": "@Test public void testFileAsRowFailsWithMoreThanOneColumn()", "identifier": "testFileAsRowFailsWithMoreThanOneColumn", "invocations": [ "expect", "expectMessage", "addOption", "add", "getTupleDescription", "add", "getTupleDescription", "initialize" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFileAsRowFailsWithMoreThanOneColumn()", "testcase": true }
{ "fields": [ { "declarator": "fileAsRow", "modifier": "private", "original_string": "private boolean fileAsRow;", "type": "boolean", "var_name": "fileAsRow" }, { "declarator": "firstLine", "modifier": "private", "original_string": "private boolean firstLine, lastLine;", "type": "boolean", "var_name": "firstLine" }, { "declarator": "reader", "modifier": "", "original_string": "BufferedReader reader;", "type": "BufferedReader", "var_name": "reader" }, { "declarator": "lineQueue", "modifier": "", "original_string": "Queue<String> lineQueue;", "type": "Queue<String>", "var_name": "lineQueue" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/QuotedLineBreakAccessor.java", "identifier": "QuotedLineBreakAccessor", "interfaces": "", "methods": [ { "class_method_signature": "QuotedLineBreakAccessor.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "QuotedLineBreakAccessor.openForRead()", "constructor": false, "full_signature": "@Override public boolean openForRead()", "identifier": "openForRead", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForRead()", "testcase": false }, { "class_method_signature": "QuotedLineBreakAccessor.readNextObject()", "constructor": false, "full_signature": "@Override public OneRow readNextObject()", "identifier": "readNextObject", "modifiers": "@Override public", "parameters": "()", "return": "OneRow", "signature": "OneRow readNextObject()", "testcase": false }, { "class_method_signature": "QuotedLineBreakAccessor.readLine()", "constructor": false, "full_signature": " String readLine()", "identifier": "readLine", "modifiers": "", "parameters": "()", "return": "String", "signature": "String readLine()", "testcase": false }, { "class_method_signature": "QuotedLineBreakAccessor.openForWrite()", "constructor": false, "full_signature": "@Override public boolean openForWrite()", "identifier": "openForWrite", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForWrite()", "testcase": false }, { "class_method_signature": "QuotedLineBreakAccessor.writeNextObject(OneRow onerow)", "constructor": false, "full_signature": "@Override public boolean writeNextObject(OneRow onerow)", "identifier": "writeNextObject", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "boolean", "signature": "boolean writeNextObject(OneRow onerow)", "testcase": false }, { "class_method_signature": "QuotedLineBreakAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false } ], "superclass": "extends HdfsAtomicDataAccessor" }
{ "body": "@Override\n public void initialize(RequestContext requestContext) {\n super.initialize(requestContext);\n\n // true if the files are read as a single row, false otherwise\n fileAsRow = StringUtils.equalsIgnoreCase(\"true\", context.getOption(\"FILE_AS_ROW\"));\n\n if (fileAsRow && context.getTupleDescription().size() != 1) {\n throw new IllegalArgumentException(String.format(\"the FILE_AS_ROW \" +\n \"property only supports tables with a single column in \" +\n \"the table definition. %d columns were provided\",\n context.getTupleDescription().size()));\n }\n }", "class_method_signature": "QuotedLineBreakAccessor.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "invocations": [ "initialize", "equalsIgnoreCase", "getOption", "size", "getTupleDescription", "format", "size", "getTupleDescription" ], "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_111
{ "fields": [ { "declarator": "serverName", "modifier": "private", "original_string": "private String serverName;", "type": "String", "var_name": "serverName" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "ugi", "modifier": "private", "original_string": "private UserGroupInformation ugi;", "type": "UserGroupInformation", "var_name": "ugi" }, { "declarator": "subject", "modifier": "private", "original_string": "private Subject subject;", "type": "Subject", "var_name": "subject" }, { "declarator": "user", "modifier": "private", "original_string": "private User user;", "type": "User", "var_name": "user" }, { "declarator": "mockLoginContext", "modifier": "private", "original_string": "private LoginContext mockLoginContext, mockAnotherLoginContext;", "type": "LoginContext", "var_name": "mockLoginContext" }, { "declarator": "mockTGT", "modifier": "private", "original_string": "private KerberosTicket mockTGT;", "type": "KerberosTicket", "var_name": "mockTGT" }, { "declarator": "tgtPrincipal = new KerberosPrincipal(\"krbtgt/EXAMPLE.COM@EXAMPLE.COM\")", "modifier": "private", "original_string": "private KerberosPrincipal tgtPrincipal = new KerberosPrincipal(\"krbtgt/EXAMPLE.COM@EXAMPLE.COM\");", "type": "KerberosPrincipal", "var_name": "tgtPrincipal" }, { "declarator": "nonTgtPrincipal = new KerberosPrincipal(\"some/somewhere@EXAMPLE.COM\")", "modifier": "private", "original_string": "private KerberosPrincipal nonTgtPrincipal = new KerberosPrincipal(\"some/somewhere@EXAMPLE.COM\");", "type": "KerberosPrincipal", "var_name": "nonTgtPrincipal" }, { "declarator": "session", "modifier": "private", "original_string": "private LoginSession session;", "type": "LoginSession", "var_name": "session" }, { "declarator": "nowMs", "modifier": "private", "original_string": "private long nowMs;", "type": "long", "var_name": "nowMs" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_KDC" }, { "declarator": "PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_REALM" }, { "declarator": "kdcDefault", "modifier": "private static", "original_string": "private static String kdcDefault;", "type": "String", "var_name": "kdcDefault" }, { "declarator": "realmDefault", "modifier": "private static", "original_string": "private static String realmDefault;", "type": "String", "var_name": "realmDefault" } ], "file": "server/pxf-api/src/test/java/org/apache/hadoop/security/PxfUserGroupInformationTest.java", "identifier": "PxfUserGroupInformationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReloginFromKeytabFailsNoKeytab() throws KerberosAuthException {\n expectedException.expect(KerberosAuthException.class);\n expectedException.expectMessage(\"loginUserFromKeyTab must be done first\");\n\n user.setLogin(mockLoginContext);\n PowerMockito.mockStatic(KerberosUtil.class);\n when(KerberosUtil.hasKerberosKeyTab(subject)).thenReturn(true);\n when(KerberosUtil.getKrb5LoginModuleName()).thenReturn(\"com.sun.security.auth.module.Krb5LoginModule\");\n ugi = new UserGroupInformation(subject);\n ugi.setAuthenticationMethod(UserGroupInformation.AuthenticationMethod.KERBEROS);\n // leave user.lastLogin at 0 to simulate old login\n session = new LoginSession(\"config\", \"principal\", null, ugi, subject, 1);\n\n PxfUserGroupInformation.reloginFromKeytab(serverName, session);\n }", "class_method_signature": "PxfUserGroupInformationTest.testReloginFromKeytabFailsNoKeytab()", "constructor": false, "full_signature": "@Test public void testReloginFromKeytabFailsNoKeytab()", "identifier": "testReloginFromKeytabFailsNoKeytab", "invocations": [ "expect", "expectMessage", "setLogin", "mockStatic", "thenReturn", "when", "hasKerberosKeyTab", "thenReturn", "when", "getKrb5LoginModuleName", "setAuthenticationMethod", "reloginFromKeytab" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testReloginFromKeytabFailsNoKeytab()", "testcase": true }
{ "fields": [ { "declarator": "LOGIN_FAILURE = \"Login failure\"", "modifier": "private static final", "original_string": "private static final String LOGIN_FAILURE = \"Login failure\";", "type": "String", "var_name": "LOGIN_FAILURE" }, { "declarator": "LOG = LoggerFactory.getLogger(\"org.greenplum.pxf.api.security.PxfUserGroupInformation\")", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(\"org.greenplum.pxf.api.security.PxfUserGroupInformation\");", "type": "Logger", "var_name": "LOG" }, { "declarator": "MUST_FIRST_LOGIN_FROM_KEYTAB = \"loginUserFromKeyTab must be done first\"", "modifier": "private static final", "original_string": "private static final String MUST_FIRST_LOGIN_FROM_KEYTAB = \"loginUserFromKeyTab must be done first\";", "type": "String", "var_name": "MUST_FIRST_LOGIN_FROM_KEYTAB" }, { "declarator": "OS_LOGIN_MODULE_NAME = getOSLoginModuleName()", "modifier": "private static final", "original_string": "private static final String OS_LOGIN_MODULE_NAME = getOSLoginModuleName();", "type": "String", "var_name": "OS_LOGIN_MODULE_NAME" }, { "declarator": "TICKET_RENEW_WINDOW = 0.80f", "modifier": "private static final", "original_string": "private static final float TICKET_RENEW_WINDOW = 0.80f;", "type": "float", "var_name": "TICKET_RENEW_WINDOW" }, { "declarator": "windows = System.getProperty(\"os.name\").startsWith(\"Windows\")", "modifier": "private static final", "original_string": "private static final boolean windows = System.getProperty(\"os.name\").startsWith(\"Windows\");", "type": "boolean", "var_name": "windows" }, { "declarator": "is64Bit = System.getProperty(\"os.arch\").contains(\"64\") ||\n System.getProperty(\"os.arch\").contains(\"s390x\")", "modifier": "private static final", "original_string": "private static final boolean is64Bit = System.getProperty(\"os.arch\").contains(\"64\") ||\n System.getProperty(\"os.arch\").contains(\"s390x\");", "type": "boolean", "var_name": "is64Bit" }, { "declarator": "aix = System.getProperty(\"os.name\").equals(\"AIX\")", "modifier": "private static final", "original_string": "private static final boolean aix = System.getProperty(\"os.name\").equals(\"AIX\");", "type": "boolean", "var_name": "aix" }, { "declarator": "subjectProvider = () -> new Subject()", "modifier": "static", "original_string": "static Supplier<Subject> subjectProvider = () -> new Subject();", "type": "Supplier<Subject>", "var_name": "subjectProvider" }, { "declarator": "loginCountMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, AtomicLong> loginCountMap = new HashMap<>();", "type": "Map<String, AtomicLong>", "var_name": "loginCountMap" }, { "declarator": "reloginCountMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, AtomicLong> reloginCountMap = new HashMap<>();", "type": "Map<String, AtomicLong>", "var_name": "reloginCountMap" } ], "file": "server/pxf-api/src/main/java/org/apache/hadoop/security/PxfUserGroupInformation.java", "identifier": "PxfUserGroupInformation", "interfaces": "", "methods": [ { "class_method_signature": "PxfUserGroupInformation.loginUserFromKeytab(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "constructor": false, "full_signature": "public synchronized static LoginSession loginUserFromKeytab(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "identifier": "loginUserFromKeytab", "modifiers": "public synchronized static", "parameters": "(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "return": "LoginSession", "signature": "LoginSession loginUserFromKeytab(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.reloginFromKeytab(String serverName, LoginSession loginSession)", "constructor": false, "full_signature": "public static void reloginFromKeytab(String serverName, LoginSession loginSession)", "identifier": "reloginFromKeytab", "modifiers": "public static", "parameters": "(String serverName, LoginSession loginSession)", "return": "void", "signature": "void reloginFromKeytab(String serverName, LoginSession loginSession)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getKerberosMinMillisBeforeRelogin(String serverName, Configuration configuration)", "constructor": false, "full_signature": "public static long getKerberosMinMillisBeforeRelogin(String serverName, Configuration configuration)", "identifier": "getKerberosMinMillisBeforeRelogin", "modifiers": "public static", "parameters": "(String serverName, Configuration configuration)", "return": "long", "signature": "long getKerberosMinMillisBeforeRelogin(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.fixKerberosTicketOrder(Subject subject)", "constructor": false, "full_signature": "static private void fixKerberosTicketOrder(Subject subject)", "identifier": "fixKerberosTicketOrder", "modifiers": "static private", "parameters": "(Subject subject)", "return": "void", "signature": "void fixKerberosTicketOrder(Subject subject)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getRefreshTime(KerberosTicket tgt)", "constructor": false, "full_signature": "private static long getRefreshTime(KerberosTicket tgt)", "identifier": "getRefreshTime", "modifiers": "private static", "parameters": "(KerberosTicket tgt)", "return": "long", "signature": "long getRefreshTime(KerberosTicket tgt)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.newLoginContext(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "constructor": false, "full_signature": "private static LoginContext newLoginContext(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "identifier": "newLoginContext", "modifiers": "private static", "parameters": "(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "return": "LoginContext", "signature": "LoginContext newLoginContext(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getOSLoginModuleName()", "constructor": false, "full_signature": "private static String getOSLoginModuleName()", "identifier": "getOSLoginModuleName", "modifiers": "private static", "parameters": "()", "return": "String", "signature": "String getOSLoginModuleName()", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getTGT(Subject subject)", "constructor": false, "full_signature": "private static synchronized KerberosTicket getTGT(Subject subject)", "identifier": "getTGT", "modifiers": "private static synchronized", "parameters": "(Subject subject)", "return": "KerberosTicket", "signature": "KerberosTicket getTGT(Subject subject)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.hasSufficientTimeElapsed(long now, LoginSession loginSession)", "constructor": false, "full_signature": "private static boolean hasSufficientTimeElapsed(long now, LoginSession loginSession)", "identifier": "hasSufficientTimeElapsed", "modifiers": "private static", "parameters": "(long now, LoginSession loginSession)", "return": "boolean", "signature": "boolean hasSufficientTimeElapsed(long now, LoginSession loginSession)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.prependFileAuthority(String keytabPath)", "constructor": false, "full_signature": "private static String prependFileAuthority(String keytabPath)", "identifier": "prependFileAuthority", "modifiers": "private static", "parameters": "(String keytabPath)", "return": "String", "signature": "String prependFileAuthority(String keytabPath)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.trackEventPerServer(String serverName, Map<String, AtomicLong> map)", "constructor": false, "full_signature": "private static void trackEventPerServer(String serverName, Map<String, AtomicLong> map)", "identifier": "trackEventPerServer", "modifiers": "private static", "parameters": "(String serverName, Map<String, AtomicLong> map)", "return": "void", "signature": "void trackEventPerServer(String serverName, Map<String, AtomicLong> map)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.logStatistics(String serverName)", "constructor": false, "full_signature": "private static void logStatistics(String serverName)", "identifier": "logStatistics", "modifiers": "private static", "parameters": "(String serverName)", "return": "void", "signature": "void logStatistics(String serverName)", "testcase": false } ], "superclass": "" }
{ "body": "public static void reloginFromKeytab(String serverName, LoginSession loginSession) throws KerberosAuthException {\n\n UserGroupInformation ugi = loginSession.getLoginUser();\n\n if (ugi.getAuthenticationMethod() != UserGroupInformation.AuthenticationMethod.KERBEROS ||\n !ugi.isFromKeytab()) {\n LOG.error(\"Did not attempt to relogin from keytab: auth={}, fromKeyTab={}\", ugi.getAuthenticationMethod(), ugi.isFromKeytab());\n return;\n }\n\n synchronized (loginSession) {\n long now = Time.now();\n if (!hasSufficientTimeElapsed(now, loginSession)) {\n return;\n }\n\n Subject subject = loginSession.getSubject();\n KerberosTicket tgt = getTGT(subject);\n //Return if TGT is valid and is not going to expire soon.\n if (tgt != null && now < getRefreshTime(tgt)) {\n return;\n }\n\n User user = loginSession.getUser();\n LoginContext login = user.getLogin();\n String keytabFile = loginSession.getKeytabPath();\n String keytabPrincipal = loginSession.getPrincipalName();\n\n if (login == null || keytabFile == null) {\n throw new KerberosAuthException(MUST_FIRST_LOGIN_FROM_KEYTAB);\n }\n\n // register most recent relogin attempt\n user.setLastLogin(now);\n try {\n LOG.debug(\"Initiating logout for {}\", user.getName());\n synchronized (UserGroupInformation.class) {\n // clear up the kerberos state. But the tokens are not cleared! As per\n // the Java kerberos login module code, only the kerberos credentials\n // are cleared\n login.logout();\n // login and also update the subject field of this instance to\n // have the new credentials (pass it to the LoginContext constructor)\n login = newLoginContext(\n HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject,\n new HadoopConfiguration(keytabPrincipal, keytabFile));\n LOG.info(\"Initiating re-login for {} for server {}\", keytabPrincipal, serverName);\n login.login();\n fixKerberosTicketOrder(subject);\n user.setLogin(login);\n }\n } catch (LoginException le) {\n KerberosAuthException kae = new KerberosAuthException(LOGIN_FAILURE, le);\n kae.setPrincipal(keytabPrincipal);\n kae.setKeytabFile(keytabFile);\n throw kae;\n }\n\n // Keep track of the number of relogins per server to make sure\n // we are not re-logging in too often\n trackEventPerServer(serverName, reloginCountMap);\n }\n\n logStatistics(serverName);\n }", "class_method_signature": "PxfUserGroupInformation.reloginFromKeytab(String serverName, LoginSession loginSession)", "constructor": false, "full_signature": "public static void reloginFromKeytab(String serverName, LoginSession loginSession)", "identifier": "reloginFromKeytab", "invocations": [ "getLoginUser", "getAuthenticationMethod", "isFromKeytab", "error", "getAuthenticationMethod", "isFromKeytab", "now", "hasSufficientTimeElapsed", "getSubject", "getTGT", "getRefreshTime", "getUser", "getLogin", "getKeytabPath", "getPrincipalName", "setLastLogin", "debug", "getName", "logout", "newLoginContext", "info", "login", "fixKerberosTicketOrder", "setLogin", "setPrincipal", "setKeytabFile", "trackEventPerServer", "logStatistics" ], "modifiers": "public static", "parameters": "(String serverName, LoginSession loginSession)", "return": "void", "signature": "void reloginFromKeytab(String serverName, LoginSession loginSession)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_404
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3SelectAccessorTest.java", "identifier": "S3SelectAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFileHeaderInfoIsUse() {\n RequestContext context = getDefaultRequestContext();\n context.addOption(\"FILE_HEADER\", \"USE\");\n InputSerialization inputSerialization =\n new S3SelectAccessor().getInputSerialization(context);\n assertEquals(\"USE\", inputSerialization.getCsv().getFileHeaderInfo());\n }", "class_method_signature": "S3SelectAccessorTest.testFileHeaderInfoIsUse()", "constructor": false, "full_signature": "@Test public void testFileHeaderInfoIsUse()", "identifier": "testFileHeaderInfoIsUse", "invocations": [ "getDefaultRequestContext", "addOption", "getInputSerialization", "assertEquals", "getFileHeaderInfo", "getCsv" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFileHeaderInfoIsUse()", "testcase": true }
{ "fields": [ { "declarator": "COMPRESSION_TYPE = \"COMPRESSION_CODEC\"", "modifier": "public static final", "original_string": "public static final String COMPRESSION_TYPE = \"COMPRESSION_CODEC\";", "type": "String", "var_name": "COMPRESSION_TYPE" }, { "declarator": "FILE_HEADER_INFO = \"FILE_HEADER\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO = \"FILE_HEADER\";", "type": "String", "var_name": "FILE_HEADER_INFO" }, { "declarator": "FILE_HEADER_INFO_NONE = \"NONE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_NONE = \"NONE\";", "type": "String", "var_name": "FILE_HEADER_INFO_NONE" }, { "declarator": "FILE_HEADER_INFO_IGNORE = \"IGNORE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_IGNORE = \"IGNORE\";", "type": "String", "var_name": "FILE_HEADER_INFO_IGNORE" }, { "declarator": "FILE_HEADER_INFO_USE = \"USE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_USE = \"USE\";", "type": "String", "var_name": "FILE_HEADER_INFO_USE" }, { "declarator": "JSON_TYPE = \"JSON-TYPE\"", "modifier": "public static final", "original_string": "public static final String JSON_TYPE = \"JSON-TYPE\";", "type": "String", "var_name": "JSON_TYPE" }, { "declarator": "isResultComplete", "modifier": "private", "original_string": "private AtomicBoolean isResultComplete;", "type": "AtomicBoolean", "var_name": "isResultComplete" }, { "declarator": "s3Client", "modifier": "private", "original_string": "private AmazonS3 s3Client;", "type": "AmazonS3", "var_name": "s3Client" }, { "declarator": "result", "modifier": "private", "original_string": "private SelectObjectContentResult result;", "type": "SelectObjectContentResult", "var_name": "result" }, { "declarator": "resultInputStream", "modifier": "private", "original_string": "private InputStream resultInputStream;", "type": "InputStream", "var_name": "resultInputStream" }, { "declarator": "reader", "modifier": "private", "original_string": "private BufferedReader reader;", "type": "BufferedReader", "var_name": "reader" }, { "declarator": "lineReadCount", "modifier": "private", "original_string": "private int lineReadCount;", "type": "int", "var_name": "lineReadCount" }, { "declarator": "name", "modifier": "private", "original_string": "private URI name;", "type": "URI", "var_name": "name" } ], "file": "server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3SelectAccessor.java", "identifier": "S3SelectAccessor", "interfaces": "implements Accessor", "methods": [ { "class_method_signature": "S3SelectAccessor.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForRead()", "constructor": false, "full_signature": "@Override public boolean openForRead()", "identifier": "openForRead", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.readNextObject()", "constructor": false, "full_signature": "@Override public OneRow readNextObject()", "identifier": "readNextObject", "modifiers": "@Override public", "parameters": "()", "return": "OneRow", "signature": "OneRow readNextObject()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForRead()", "constructor": false, "full_signature": "@Override public void closeForRead()", "identifier": "closeForRead", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.generateBaseCSVRequest(RequestContext context)", "constructor": false, "full_signature": " SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "identifier": "generateBaseCSVRequest", "modifiers": "", "parameters": "(RequestContext context)", "return": "SelectObjectContentRequest", "signature": "SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getOutputSerialization(RequestContext context)", "constructor": false, "full_signature": "private OutputSerialization getOutputSerialization(RequestContext context)", "identifier": "getOutputSerialization", "modifiers": "private", "parameters": "(RequestContext context)", "return": "OutputSerialization", "signature": "OutputSerialization getOutputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getInputSerialization(RequestContext context)", "constructor": false, "full_signature": " InputSerialization getInputSerialization(RequestContext context)", "identifier": "getInputSerialization", "modifiers": "", "parameters": "(RequestContext context)", "return": "InputSerialization", "signature": "InputSerialization getInputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getJSONInput(RequestContext context)", "constructor": false, "full_signature": " JSONInput getJSONInput(RequestContext context)", "identifier": "getJSONInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "JSONInput", "signature": "JSONInput getJSONInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getCSVInput(RequestContext context)", "constructor": false, "full_signature": " CSVInput getCSVInput(RequestContext context)", "identifier": "getCSVInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "CSVInput", "signature": "CSVInput getCSVInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.initS3Client()", "constructor": false, "full_signature": "private AmazonS3 initS3Client()", "identifier": "initS3Client", "modifiers": "private", "parameters": "()", "return": "AmazonS3", "signature": "AmazonS3 initS3Client()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForWrite()", "constructor": false, "full_signature": "@Override public boolean openForWrite()", "identifier": "openForWrite", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForWrite()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.writeNextObject(OneRow onerow)", "constructor": false, "full_signature": "@Override public boolean writeNextObject(OneRow onerow)", "identifier": "writeNextObject", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "boolean", "signature": "boolean writeNextObject(OneRow onerow)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "InputSerialization getInputSerialization(RequestContext context) {\n InputSerialization inputSerialization = new InputSerialization();\n\n // We need to infer the format name from the profile (i.e. s3:parquet\n // would return parquet for the format)\n String format = context.inferFormatName();\n String compressionType = context.getOption(COMPRESSION_TYPE);\n\n LOG.debug(\"With format {}\", format);\n if (StringUtils.equalsIgnoreCase(format, \"parquet\")) {\n inputSerialization.setParquet(new ParquetInput());\n } else if (StringUtils.equalsIgnoreCase(format, \"json\")) {\n inputSerialization.setJson(getJSONInput(context));\n } else {\n inputSerialization.setCsv(getCSVInput(context));\n }\n\n LOG.debug(\"With compression type {}\", compressionType);\n if (StringUtils.equalsIgnoreCase(compressionType, \"gzip\")) {\n inputSerialization.setCompressionType(CompressionType.GZIP);\n } else if (StringUtils.equalsIgnoreCase(compressionType, \"bzip2\")) {\n inputSerialization.setCompressionType(CompressionType.BZIP2);\n } else {\n inputSerialization.setCompressionType(CompressionType.NONE);\n }\n\n return inputSerialization;\n }", "class_method_signature": "S3SelectAccessor.getInputSerialization(RequestContext context)", "constructor": false, "full_signature": " InputSerialization getInputSerialization(RequestContext context)", "identifier": "getInputSerialization", "invocations": [ "inferFormatName", "getOption", "debug", "equalsIgnoreCase", "setParquet", "equalsIgnoreCase", "setJson", "getJSONInput", "setCsv", "getCSVInput", "debug", "equalsIgnoreCase", "setCompressionType", "equalsIgnoreCase", "setCompressionType", "setCompressionType" ], "modifiers": "", "parameters": "(RequestContext context)", "return": "InputSerialization", "signature": "InputSerialization getInputSerialization(RequestContext context)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_392
{ "fields": [ { "declarator": "FILE_FRAGMENTER = \"org.greenplum.pxf.plugins.hdfs.HdfsFileFragmenter\"", "modifier": "private static final", "original_string": "private static final String FILE_FRAGMENTER = \"org.greenplum.pxf.plugins.hdfs.HdfsFileFragmenter\";", "type": "String", "var_name": "FILE_FRAGMENTER" }, { "declarator": "STRING_PASS_RESOLVER = \"org.greenplum.pxf.plugins.hdfs.StringPassResolver\"", "modifier": "private static final", "original_string": "private static final String STRING_PASS_RESOLVER = \"org.greenplum.pxf.plugins.hdfs.StringPassResolver\";", "type": "String", "var_name": "STRING_PASS_RESOLVER" }, { "declarator": "S3_ACCESSOR = S3SelectAccessor.class.getName()", "modifier": "private static final", "original_string": "private static final String S3_ACCESSOR = S3SelectAccessor.class.getName();", "type": "String", "var_name": "S3_ACCESSOR" }, { "declarator": "DEFAULT_ACCESSOR = \"default-accessor\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_ACCESSOR = \"default-accessor\";", "type": "String", "var_name": "DEFAULT_ACCESSOR" }, { "declarator": "DEFAULT_RESOLVER = \"default-resolver\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_RESOLVER = \"default-resolver\";", "type": "String", "var_name": "DEFAULT_RESOLVER" }, { "declarator": "DEFAULT_FRAGMENTER = \"default-fragmenter\"", "modifier": "private static final", "original_string": "private static final String DEFAULT_FRAGMENTER = \"default-fragmenter\";", "type": "String", "var_name": "DEFAULT_FRAGMENTER" }, { "declarator": "NOT_SUPPORTED = \"ERROR\"", "modifier": "private static final", "original_string": "private static final String NOT_SUPPORTED = \"ERROR\";", "type": "String", "var_name": "NOT_SUPPORTED" }, { "declarator": "FORMATS = {\"parquet\", \"text\", \"csv\", \"json\", \"avro\"}", "modifier": "private static", "original_string": "private static String[] FORMATS = {\"parquet\", \"text\", \"csv\", \"json\", \"avro\"};", "type": "String[]", "var_name": "FORMATS" }, { "declarator": "EXPECTED_RESOLVER_TEXT_ON = {STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, NOT_SUPPORTED}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_TEXT_ON = {STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, NOT_SUPPORTED};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_TEXT_ON" }, { "declarator": "EXPECTED_RESOLVER_TEXT_AUTO_BENEFIT = {STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_TEXT_AUTO_BENEFIT = {STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_TEXT_AUTO_BENEFIT" }, { "declarator": "EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT" }, { "declarator": "EXPECTED_RESOLVER_TEXT_OFF = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_TEXT_OFF = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_TEXT_OFF" }, { "declarator": "EXPECTED_RESOLVER_GPDB_WRITABLE_ON = {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_GPDB_WRITABLE_ON = {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_GPDB_WRITABLE_ON" }, { "declarator": "EXPECTED_RESOLVER_GPDB_WRITABLE_AUTO = {DEFAULT_RESOLVER, NOT_SUPPORTED, NOT_SUPPORTED, DEFAULT_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_GPDB_WRITABLE_AUTO = {DEFAULT_RESOLVER, NOT_SUPPORTED, NOT_SUPPORTED, DEFAULT_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_GPDB_WRITABLE_AUTO" }, { "declarator": "EXPECTED_RESOLVER_GPDB_WRITABLE_OFF = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_GPDB_WRITABLE_OFF = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_GPDB_WRITABLE_OFF" }, { "declarator": "EXPECTED_FRAGMENTER_TEXT_ON = {FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, NOT_SUPPORTED}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_TEXT_ON = {FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, NOT_SUPPORTED};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_TEXT_ON" }, { "declarator": "EXPECTED_FRAGMENTER_TEXT_AUTO_BENEFIT = {FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_TEXT_AUTO_BENEFIT = {FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_TEXT_AUTO_BENEFIT" }, { "declarator": "EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT" }, { "declarator": "EXPECTED_FRAGMENTER_TEXT_OFF = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_TEXT_OFF = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_TEXT_OFF" }, { "declarator": "EXPECTED_FRAGMENTER_GPDB_WRITABLE_ON = {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_GPDB_WRITABLE_ON = {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_GPDB_WRITABLE_ON" }, { "declarator": "EXPECTED_FRAGMENTER_GPDB_WRITABLE_AUTO = {DEFAULT_FRAGMENTER, NOT_SUPPORTED, NOT_SUPPORTED, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_GPDB_WRITABLE_AUTO = {DEFAULT_FRAGMENTER, NOT_SUPPORTED, NOT_SUPPORTED, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_GPDB_WRITABLE_AUTO" }, { "declarator": "EXPECTED_FRAGMENTER_GPDB_WRITABLE_OFF = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_GPDB_WRITABLE_OFF = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_GPDB_WRITABLE_OFF" }, { "declarator": "EXPECTED_ACCESSOR_TEXT_ON = {S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, NOT_SUPPORTED}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_TEXT_ON = {S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, NOT_SUPPORTED};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_TEXT_ON" }, { "declarator": "EXPECTED_ACCESSOR_TEXT_AUTO_BENEFIT = {S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_TEXT_AUTO_BENEFIT = {S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_TEXT_AUTO_BENEFIT" }, { "declarator": "EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT" }, { "declarator": "EXPECTED_ACCESSOR_TEXT_OFF = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_TEXT_OFF = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_TEXT_OFF" }, { "declarator": "EXPECTED_ACCESSOR_GPDB_WRITABLE_ON = {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_GPDB_WRITABLE_ON = {NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED, NOT_SUPPORTED};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_GPDB_WRITABLE_ON" }, { "declarator": "EXPECTED_ACCESSOR_GPDB_WRITABLE_AUTO = {DEFAULT_ACCESSOR, NOT_SUPPORTED, NOT_SUPPORTED, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_GPDB_WRITABLE_AUTO = {DEFAULT_ACCESSOR, NOT_SUPPORTED, NOT_SUPPORTED, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_GPDB_WRITABLE_AUTO" }, { "declarator": "EXPECTED_ACCESSOR_GPDB_WRITABLE_OFF = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_GPDB_WRITABLE_OFF = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_GPDB_WRITABLE_OFF" }, { "declarator": "EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS = {DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, DEFAULT_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS" }, { "declarator": "EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS = {DEFAULT_RESOLVER, DEFAULT_RESOLVER, DEFAULT_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS" }, { "declarator": "EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS = {DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, DEFAULT_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_FORMAT_OPTIONS" }, { "declarator": "EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR}", "modifier": "private static", "original_string": "private static String[] EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, S3_ACCESSOR, DEFAULT_ACCESSOR};", "type": "String[]", "var_name": "EXPECTED_ACCESSOR_TEXT_AUTO_NO_BENEFIT_HAS_HEADER" }, { "declarator": "EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, STRING_PASS_RESOLVER, DEFAULT_RESOLVER};", "type": "String[]", "var_name": "EXPECTED_RESOLVER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER" }, { "declarator": "EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER}", "modifier": "private static", "original_string": "private static String[] EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER = {DEFAULT_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, FILE_FRAGMENTER, DEFAULT_FRAGMENTER};", "type": "String[]", "var_name": "EXPECTED_FRAGMENTER_TEXT_AUTO_NO_BENEFIT_HAS_HEADER" }, { "declarator": "handler", "modifier": "private", "original_string": "private S3ProtocolHandler handler;", "type": "S3ProtocolHandler", "var_name": "handler" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandlerTest.java", "identifier": "S3ProtocolHandlerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testSelectInvalid() {\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"Invalid value 'foo' for S3_SELECT option\");\n\n context.setFormat(\"CSV\");\n context.addOption(\"S3_SELECT\", \"foo\");\n handler.getAccessorClassName(context);\n }", "class_method_signature": "S3ProtocolHandlerTest.testSelectInvalid()", "constructor": false, "full_signature": "@Test public void testSelectInvalid()", "identifier": "testSelectInvalid", "invocations": [ "expect", "expectMessage", "setFormat", "addOption", "getAccessorClassName" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testSelectInvalid()", "testcase": true }
{ "fields": [ { "declarator": "S3_SELECT_OPTION = \"S3_SELECT\"", "modifier": "public static final", "original_string": "public static final String S3_SELECT_OPTION = \"S3_SELECT\";", "type": "String", "var_name": "S3_SELECT_OPTION" }, { "declarator": "LOG = LoggerFactory.getLogger(S3ProtocolHandler.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(S3ProtocolHandler.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "SUPPORTED_FORMATS = Sets.newHashSet(\"TEXT\", \"CSV\", \"PARQUET\", \"JSON\")", "modifier": "private static final", "original_string": "private static final Set<String> SUPPORTED_FORMATS = Sets.newHashSet(\"TEXT\", \"CSV\", \"PARQUET\", \"JSON\");", "type": "Set<String>", "var_name": "SUPPORTED_FORMATS" }, { "declarator": "SUPPORTED_COMPRESSION_TYPE_FOR_TEXT = Sets.newHashSet(\"GZIP\", \"BZIP2\")", "modifier": "private static final", "original_string": "private static final Set<String> SUPPORTED_COMPRESSION_TYPE_FOR_TEXT = Sets.newHashSet(\"GZIP\", \"BZIP2\");", "type": "Set<String>", "var_name": "SUPPORTED_COMPRESSION_TYPE_FOR_TEXT" }, { "declarator": "SUPPORTED_COMPRESSION_TYPE_FOR_PARQUET = Sets.newHashSet(\"GZIP\", \"SNAPPY\")", "modifier": "private static final", "original_string": "private static final Set<String> SUPPORTED_COMPRESSION_TYPE_FOR_PARQUET = Sets.newHashSet(\"GZIP\", \"SNAPPY\");", "type": "Set<String>", "var_name": "SUPPORTED_COMPRESSION_TYPE_FOR_PARQUET" }, { "declarator": "SUPPORTED_COMPRESSION_TYPES =\n Collections.unmodifiableMap(new HashMap<String, Set<String>>() {{\n put(\"TEXT\", SUPPORTED_COMPRESSION_TYPE_FOR_TEXT);\n put(\"CSV\", SUPPORTED_COMPRESSION_TYPE_FOR_TEXT);\n put(\"JSON\", SUPPORTED_COMPRESSION_TYPE_FOR_TEXT);\n put(\"PARQUET\", SUPPORTED_COMPRESSION_TYPE_FOR_PARQUET);\n }})", "modifier": "private static final", "original_string": "private static final Map<String, Set<String>> SUPPORTED_COMPRESSION_TYPES =\n Collections.unmodifiableMap(new HashMap<String, Set<String>>() {{\n put(\"TEXT\", SUPPORTED_COMPRESSION_TYPE_FOR_TEXT);\n put(\"CSV\", SUPPORTED_COMPRESSION_TYPE_FOR_TEXT);\n put(\"JSON\", SUPPORTED_COMPRESSION_TYPE_FOR_TEXT);\n put(\"PARQUET\", SUPPORTED_COMPRESSION_TYPE_FOR_PARQUET);\n }});", "type": "Map<String, Set<String>>", "var_name": "SUPPORTED_COMPRESSION_TYPES" }, { "declarator": "SUPPORT_MATRIX = Sets.newHashSet(\n new SupportMatrixEntry(\"PARQUET\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"TEXT\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"CSV\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"JSON\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"PARQUET\", OutputFormat.TEXT, S3Mode.OFF),\n new SupportMatrixEntry(\"TEXT\", OutputFormat.TEXT, S3Mode.OFF),\n new SupportMatrixEntry(\"CSV\", OutputFormat.TEXT, S3Mode.OFF),\n new SupportMatrixEntry(\"PARQUET\", OutputFormat.GPDBWritable, S3Mode.OFF),\n new SupportMatrixEntry(\"JSON\", OutputFormat.GPDBWritable, S3Mode.OFF)\n )", "modifier": "private static final", "original_string": "private static final Set<SupportMatrixEntry> SUPPORT_MATRIX = Sets.newHashSet(\n new SupportMatrixEntry(\"PARQUET\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"TEXT\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"CSV\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"JSON\", OutputFormat.TEXT, S3Mode.ON),\n new SupportMatrixEntry(\"PARQUET\", OutputFormat.TEXT, S3Mode.OFF),\n new SupportMatrixEntry(\"TEXT\", OutputFormat.TEXT, S3Mode.OFF),\n new SupportMatrixEntry(\"CSV\", OutputFormat.TEXT, S3Mode.OFF),\n new SupportMatrixEntry(\"PARQUET\", OutputFormat.GPDBWritable, S3Mode.OFF),\n new SupportMatrixEntry(\"JSON\", OutputFormat.GPDBWritable, S3Mode.OFF)\n );", "type": "Set<SupportMatrixEntry>", "var_name": "SUPPORT_MATRIX" }, { "declarator": "STRING_PASS_RESOLVER = \"org.greenplum.pxf.plugins.hdfs.StringPassResolver\"", "modifier": "private static final", "original_string": "private static final String STRING_PASS_RESOLVER = \"org.greenplum.pxf.plugins.hdfs.StringPassResolver\";", "type": "String", "var_name": "STRING_PASS_RESOLVER" }, { "declarator": "HCFS_FILE_FRAGMENTER = \"org.greenplum.pxf.plugins.hdfs.HdfsFileFragmenter\"", "modifier": "private static final", "original_string": "private static final String HCFS_FILE_FRAGMENTER = \"org.greenplum.pxf.plugins.hdfs.HdfsFileFragmenter\";", "type": "String", "var_name": "HCFS_FILE_FRAGMENTER" } ], "file": "server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3ProtocolHandler.java", "identifier": "S3ProtocolHandler", "interfaces": "implements ProtocolHandler", "methods": [ { "class_method_signature": "S3ProtocolHandler.getFragmenterClassName(RequestContext context)", "constructor": false, "full_signature": "@Override public String getFragmenterClassName(RequestContext context)", "identifier": "getFragmenterClassName", "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "String", "signature": "String getFragmenterClassName(RequestContext context)", "testcase": false }, { "class_method_signature": "S3ProtocolHandler.getAccessorClassName(RequestContext context)", "constructor": false, "full_signature": "@Override public String getAccessorClassName(RequestContext context)", "identifier": "getAccessorClassName", "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "String", "signature": "String getAccessorClassName(RequestContext context)", "testcase": false }, { "class_method_signature": "S3ProtocolHandler.getResolverClassName(RequestContext context)", "constructor": false, "full_signature": "@Override public String getResolverClassName(RequestContext context)", "identifier": "getResolverClassName", "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "String", "signature": "String getResolverClassName(RequestContext context)", "testcase": false }, { "class_method_signature": "S3ProtocolHandler.useS3Select(RequestContext context)", "constructor": false, "full_signature": "private boolean useS3Select(RequestContext context)", "identifier": "useS3Select", "modifiers": "private", "parameters": "(RequestContext context)", "return": "boolean", "signature": "boolean useS3Select(RequestContext context)", "testcase": false }, { "class_method_signature": "S3ProtocolHandler.fileHasHeaderLine(String format, RequestContext context)", "constructor": false, "full_signature": "private boolean fileHasHeaderLine(String format, RequestContext context)", "identifier": "fileHasHeaderLine", "modifiers": "private", "parameters": "(String format, RequestContext context)", "return": "boolean", "signature": "boolean fileHasHeaderLine(String format, RequestContext context)", "testcase": false }, { "class_method_signature": "S3ProtocolHandler.willBenefitFromSelect(RequestContext context)", "constructor": false, "full_signature": "private boolean willBenefitFromSelect(RequestContext context)", "identifier": "willBenefitFromSelect", "modifiers": "private", "parameters": "(RequestContext context)", "return": "boolean", "signature": "boolean willBenefitFromSelect(RequestContext context)", "testcase": false }, { "class_method_signature": "S3ProtocolHandler.formatSupported(OutputFormat outputFormat, String format, S3Mode selectMode, boolean raiseException)", "constructor": false, "full_signature": "private boolean formatSupported(OutputFormat outputFormat, String format, S3Mode selectMode, boolean raiseException)", "identifier": "formatSupported", "modifiers": "private", "parameters": "(OutputFormat outputFormat, String format, S3Mode selectMode, boolean raiseException)", "return": "boolean", "signature": "boolean formatSupported(OutputFormat outputFormat, String format, S3Mode selectMode, boolean raiseException)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public String getAccessorClassName(RequestContext context) {\n String accessor = context.getAccessor(); // default to accessor defined by the profile\n if (useS3Select(context)) {\n accessor = S3SelectAccessor.class.getName();\n }\n LOG.debug(\"Determined to use {} accessor\", accessor);\n return accessor;\n }", "class_method_signature": "S3ProtocolHandler.getAccessorClassName(RequestContext context)", "constructor": false, "full_signature": "@Override public String getAccessorClassName(RequestContext context)", "identifier": "getAccessorClassName", "invocations": [ "getAccessor", "useS3Select", "getName", "debug" ], "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "String", "signature": "String getAccessorClassName(RequestContext context)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_238
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnRead() {\n context.setRequestType(RequestContext.RequestType.READ_BRIDGE);\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifySchema(schema, \"example_schema\");\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnRead()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnRead()", "identifier": "testObtainSchema_OnRead", "invocations": [ "setRequestType", "obtainSchema", "verifySchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnRead()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_107
{ "fields": [ { "declarator": "serverName", "modifier": "private", "original_string": "private String serverName;", "type": "String", "var_name": "serverName" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "ugi", "modifier": "private", "original_string": "private UserGroupInformation ugi;", "type": "UserGroupInformation", "var_name": "ugi" }, { "declarator": "subject", "modifier": "private", "original_string": "private Subject subject;", "type": "Subject", "var_name": "subject" }, { "declarator": "user", "modifier": "private", "original_string": "private User user;", "type": "User", "var_name": "user" }, { "declarator": "mockLoginContext", "modifier": "private", "original_string": "private LoginContext mockLoginContext, mockAnotherLoginContext;", "type": "LoginContext", "var_name": "mockLoginContext" }, { "declarator": "mockTGT", "modifier": "private", "original_string": "private KerberosTicket mockTGT;", "type": "KerberosTicket", "var_name": "mockTGT" }, { "declarator": "tgtPrincipal = new KerberosPrincipal(\"krbtgt/EXAMPLE.COM@EXAMPLE.COM\")", "modifier": "private", "original_string": "private KerberosPrincipal tgtPrincipal = new KerberosPrincipal(\"krbtgt/EXAMPLE.COM@EXAMPLE.COM\");", "type": "KerberosPrincipal", "var_name": "tgtPrincipal" }, { "declarator": "nonTgtPrincipal = new KerberosPrincipal(\"some/somewhere@EXAMPLE.COM\")", "modifier": "private", "original_string": "private KerberosPrincipal nonTgtPrincipal = new KerberosPrincipal(\"some/somewhere@EXAMPLE.COM\");", "type": "KerberosPrincipal", "var_name": "nonTgtPrincipal" }, { "declarator": "session", "modifier": "private", "original_string": "private LoginSession session;", "type": "LoginSession", "var_name": "session" }, { "declarator": "nowMs", "modifier": "private", "original_string": "private long nowMs;", "type": "long", "var_name": "nowMs" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_KDC" }, { "declarator": "PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_REALM" }, { "declarator": "kdcDefault", "modifier": "private static", "original_string": "private static String kdcDefault;", "type": "String", "var_name": "kdcDefault" }, { "declarator": "realmDefault", "modifier": "private static", "original_string": "private static String realmDefault;", "type": "String", "var_name": "realmDefault" } ], "file": "server/pxf-api/src/test/java/org/apache/hadoop/security/PxfUserGroupInformationTest.java", "identifier": "PxfUserGroupInformationTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testReloginFromKeytabNoopForNonKeytab() throws KerberosAuthException {\n user.setLogin(mockLoginContext);\n PowerMockito.mockStatic(KerberosUtil.class);\n when(KerberosUtil.hasKerberosKeyTab(subject)).thenReturn(false); // simulate no keytab for subject\n ugi = new UserGroupInformation(subject);\n ugi.setAuthenticationMethod(UserGroupInformation.AuthenticationMethod.KERBEROS);\n session = new LoginSession(\"config\", \"principal\", \"keytab\", ugi, subject, 1);\n\n PxfUserGroupInformation.reloginFromKeytab(serverName, session);\n\n verifyZeroInteractions(mockLoginContext); // proves noop\n }", "class_method_signature": "PxfUserGroupInformationTest.testReloginFromKeytabNoopForNonKeytab()", "constructor": false, "full_signature": "@Test public void testReloginFromKeytabNoopForNonKeytab()", "identifier": "testReloginFromKeytabNoopForNonKeytab", "invocations": [ "setLogin", "mockStatic", "thenReturn", "when", "hasKerberosKeyTab", "setAuthenticationMethod", "reloginFromKeytab", "verifyZeroInteractions" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testReloginFromKeytabNoopForNonKeytab()", "testcase": true }
{ "fields": [ { "declarator": "LOGIN_FAILURE = \"Login failure\"", "modifier": "private static final", "original_string": "private static final String LOGIN_FAILURE = \"Login failure\";", "type": "String", "var_name": "LOGIN_FAILURE" }, { "declarator": "LOG = LoggerFactory.getLogger(\"org.greenplum.pxf.api.security.PxfUserGroupInformation\")", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(\"org.greenplum.pxf.api.security.PxfUserGroupInformation\");", "type": "Logger", "var_name": "LOG" }, { "declarator": "MUST_FIRST_LOGIN_FROM_KEYTAB = \"loginUserFromKeyTab must be done first\"", "modifier": "private static final", "original_string": "private static final String MUST_FIRST_LOGIN_FROM_KEYTAB = \"loginUserFromKeyTab must be done first\";", "type": "String", "var_name": "MUST_FIRST_LOGIN_FROM_KEYTAB" }, { "declarator": "OS_LOGIN_MODULE_NAME = getOSLoginModuleName()", "modifier": "private static final", "original_string": "private static final String OS_LOGIN_MODULE_NAME = getOSLoginModuleName();", "type": "String", "var_name": "OS_LOGIN_MODULE_NAME" }, { "declarator": "TICKET_RENEW_WINDOW = 0.80f", "modifier": "private static final", "original_string": "private static final float TICKET_RENEW_WINDOW = 0.80f;", "type": "float", "var_name": "TICKET_RENEW_WINDOW" }, { "declarator": "windows = System.getProperty(\"os.name\").startsWith(\"Windows\")", "modifier": "private static final", "original_string": "private static final boolean windows = System.getProperty(\"os.name\").startsWith(\"Windows\");", "type": "boolean", "var_name": "windows" }, { "declarator": "is64Bit = System.getProperty(\"os.arch\").contains(\"64\") ||\n System.getProperty(\"os.arch\").contains(\"s390x\")", "modifier": "private static final", "original_string": "private static final boolean is64Bit = System.getProperty(\"os.arch\").contains(\"64\") ||\n System.getProperty(\"os.arch\").contains(\"s390x\");", "type": "boolean", "var_name": "is64Bit" }, { "declarator": "aix = System.getProperty(\"os.name\").equals(\"AIX\")", "modifier": "private static final", "original_string": "private static final boolean aix = System.getProperty(\"os.name\").equals(\"AIX\");", "type": "boolean", "var_name": "aix" }, { "declarator": "subjectProvider = () -> new Subject()", "modifier": "static", "original_string": "static Supplier<Subject> subjectProvider = () -> new Subject();", "type": "Supplier<Subject>", "var_name": "subjectProvider" }, { "declarator": "loginCountMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, AtomicLong> loginCountMap = new HashMap<>();", "type": "Map<String, AtomicLong>", "var_name": "loginCountMap" }, { "declarator": "reloginCountMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, AtomicLong> reloginCountMap = new HashMap<>();", "type": "Map<String, AtomicLong>", "var_name": "reloginCountMap" } ], "file": "server/pxf-api/src/main/java/org/apache/hadoop/security/PxfUserGroupInformation.java", "identifier": "PxfUserGroupInformation", "interfaces": "", "methods": [ { "class_method_signature": "PxfUserGroupInformation.loginUserFromKeytab(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "constructor": false, "full_signature": "public synchronized static LoginSession loginUserFromKeytab(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "identifier": "loginUserFromKeytab", "modifiers": "public synchronized static", "parameters": "(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "return": "LoginSession", "signature": "LoginSession loginUserFromKeytab(Configuration configuration, String serverName, String configDirectory, String principal, String keytabFilename)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.reloginFromKeytab(String serverName, LoginSession loginSession)", "constructor": false, "full_signature": "public static void reloginFromKeytab(String serverName, LoginSession loginSession)", "identifier": "reloginFromKeytab", "modifiers": "public static", "parameters": "(String serverName, LoginSession loginSession)", "return": "void", "signature": "void reloginFromKeytab(String serverName, LoginSession loginSession)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getKerberosMinMillisBeforeRelogin(String serverName, Configuration configuration)", "constructor": false, "full_signature": "public static long getKerberosMinMillisBeforeRelogin(String serverName, Configuration configuration)", "identifier": "getKerberosMinMillisBeforeRelogin", "modifiers": "public static", "parameters": "(String serverName, Configuration configuration)", "return": "long", "signature": "long getKerberosMinMillisBeforeRelogin(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.fixKerberosTicketOrder(Subject subject)", "constructor": false, "full_signature": "static private void fixKerberosTicketOrder(Subject subject)", "identifier": "fixKerberosTicketOrder", "modifiers": "static private", "parameters": "(Subject subject)", "return": "void", "signature": "void fixKerberosTicketOrder(Subject subject)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getRefreshTime(KerberosTicket tgt)", "constructor": false, "full_signature": "private static long getRefreshTime(KerberosTicket tgt)", "identifier": "getRefreshTime", "modifiers": "private static", "parameters": "(KerberosTicket tgt)", "return": "long", "signature": "long getRefreshTime(KerberosTicket tgt)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.newLoginContext(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "constructor": false, "full_signature": "private static LoginContext newLoginContext(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "identifier": "newLoginContext", "modifiers": "private static", "parameters": "(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "return": "LoginContext", "signature": "LoginContext newLoginContext(String appName, Subject subject, javax.security.auth.login.Configuration loginConf)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getOSLoginModuleName()", "constructor": false, "full_signature": "private static String getOSLoginModuleName()", "identifier": "getOSLoginModuleName", "modifiers": "private static", "parameters": "()", "return": "String", "signature": "String getOSLoginModuleName()", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.getTGT(Subject subject)", "constructor": false, "full_signature": "private static synchronized KerberosTicket getTGT(Subject subject)", "identifier": "getTGT", "modifiers": "private static synchronized", "parameters": "(Subject subject)", "return": "KerberosTicket", "signature": "KerberosTicket getTGT(Subject subject)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.hasSufficientTimeElapsed(long now, LoginSession loginSession)", "constructor": false, "full_signature": "private static boolean hasSufficientTimeElapsed(long now, LoginSession loginSession)", "identifier": "hasSufficientTimeElapsed", "modifiers": "private static", "parameters": "(long now, LoginSession loginSession)", "return": "boolean", "signature": "boolean hasSufficientTimeElapsed(long now, LoginSession loginSession)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.prependFileAuthority(String keytabPath)", "constructor": false, "full_signature": "private static String prependFileAuthority(String keytabPath)", "identifier": "prependFileAuthority", "modifiers": "private static", "parameters": "(String keytabPath)", "return": "String", "signature": "String prependFileAuthority(String keytabPath)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.trackEventPerServer(String serverName, Map<String, AtomicLong> map)", "constructor": false, "full_signature": "private static void trackEventPerServer(String serverName, Map<String, AtomicLong> map)", "identifier": "trackEventPerServer", "modifiers": "private static", "parameters": "(String serverName, Map<String, AtomicLong> map)", "return": "void", "signature": "void trackEventPerServer(String serverName, Map<String, AtomicLong> map)", "testcase": false }, { "class_method_signature": "PxfUserGroupInformation.logStatistics(String serverName)", "constructor": false, "full_signature": "private static void logStatistics(String serverName)", "identifier": "logStatistics", "modifiers": "private static", "parameters": "(String serverName)", "return": "void", "signature": "void logStatistics(String serverName)", "testcase": false } ], "superclass": "" }
{ "body": "public static void reloginFromKeytab(String serverName, LoginSession loginSession) throws KerberosAuthException {\n\n UserGroupInformation ugi = loginSession.getLoginUser();\n\n if (ugi.getAuthenticationMethod() != UserGroupInformation.AuthenticationMethod.KERBEROS ||\n !ugi.isFromKeytab()) {\n LOG.error(\"Did not attempt to relogin from keytab: auth={}, fromKeyTab={}\", ugi.getAuthenticationMethod(), ugi.isFromKeytab());\n return;\n }\n\n synchronized (loginSession) {\n long now = Time.now();\n if (!hasSufficientTimeElapsed(now, loginSession)) {\n return;\n }\n\n Subject subject = loginSession.getSubject();\n KerberosTicket tgt = getTGT(subject);\n //Return if TGT is valid and is not going to expire soon.\n if (tgt != null && now < getRefreshTime(tgt)) {\n return;\n }\n\n User user = loginSession.getUser();\n LoginContext login = user.getLogin();\n String keytabFile = loginSession.getKeytabPath();\n String keytabPrincipal = loginSession.getPrincipalName();\n\n if (login == null || keytabFile == null) {\n throw new KerberosAuthException(MUST_FIRST_LOGIN_FROM_KEYTAB);\n }\n\n // register most recent relogin attempt\n user.setLastLogin(now);\n try {\n LOG.debug(\"Initiating logout for {}\", user.getName());\n synchronized (UserGroupInformation.class) {\n // clear up the kerberos state. But the tokens are not cleared! As per\n // the Java kerberos login module code, only the kerberos credentials\n // are cleared\n login.logout();\n // login and also update the subject field of this instance to\n // have the new credentials (pass it to the LoginContext constructor)\n login = newLoginContext(\n HadoopConfiguration.KEYTAB_KERBEROS_CONFIG_NAME, subject,\n new HadoopConfiguration(keytabPrincipal, keytabFile));\n LOG.info(\"Initiating re-login for {} for server {}\", keytabPrincipal, serverName);\n login.login();\n fixKerberosTicketOrder(subject);\n user.setLogin(login);\n }\n } catch (LoginException le) {\n KerberosAuthException kae = new KerberosAuthException(LOGIN_FAILURE, le);\n kae.setPrincipal(keytabPrincipal);\n kae.setKeytabFile(keytabFile);\n throw kae;\n }\n\n // Keep track of the number of relogins per server to make sure\n // we are not re-logging in too often\n trackEventPerServer(serverName, reloginCountMap);\n }\n\n logStatistics(serverName);\n }", "class_method_signature": "PxfUserGroupInformation.reloginFromKeytab(String serverName, LoginSession loginSession)", "constructor": false, "full_signature": "public static void reloginFromKeytab(String serverName, LoginSession loginSession)", "identifier": "reloginFromKeytab", "invocations": [ "getLoginUser", "getAuthenticationMethod", "isFromKeytab", "error", "getAuthenticationMethod", "isFromKeytab", "now", "hasSufficientTimeElapsed", "getSubject", "getTGT", "getRefreshTime", "getUser", "getLogin", "getKeytabPath", "getPrincipalName", "setLastLogin", "debug", "getName", "logout", "newLoginContext", "info", "login", "fixKerberosTicketOrder", "setLogin", "setPrincipal", "setKeytabFile", "trackEventPerServer", "logStatistics" ], "modifiers": "public static", "parameters": "(String serverName, LoginSession loginSession)", "return": "void", "signature": "void reloginFromKeytab(String serverName, LoginSession loginSession)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_412
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-s3/src/test/java/org/greenplum/pxf/plugins/s3/S3SelectAccessorTest.java", "identifier": "S3SelectAccessorTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testFailsOnCloseForWrite() {\n thrown.expect(UnsupportedOperationException.class);\n thrown.expectMessage(\"S3 Select does not support writing\");\n new S3SelectAccessor().closeForWrite();\n }", "class_method_signature": "S3SelectAccessorTest.testFailsOnCloseForWrite()", "constructor": false, "full_signature": "@Test public void testFailsOnCloseForWrite()", "identifier": "testFailsOnCloseForWrite", "invocations": [ "expect", "expectMessage", "closeForWrite" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testFailsOnCloseForWrite()", "testcase": true }
{ "fields": [ { "declarator": "COMPRESSION_TYPE = \"COMPRESSION_CODEC\"", "modifier": "public static final", "original_string": "public static final String COMPRESSION_TYPE = \"COMPRESSION_CODEC\";", "type": "String", "var_name": "COMPRESSION_TYPE" }, { "declarator": "FILE_HEADER_INFO = \"FILE_HEADER\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO = \"FILE_HEADER\";", "type": "String", "var_name": "FILE_HEADER_INFO" }, { "declarator": "FILE_HEADER_INFO_NONE = \"NONE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_NONE = \"NONE\";", "type": "String", "var_name": "FILE_HEADER_INFO_NONE" }, { "declarator": "FILE_HEADER_INFO_IGNORE = \"IGNORE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_IGNORE = \"IGNORE\";", "type": "String", "var_name": "FILE_HEADER_INFO_IGNORE" }, { "declarator": "FILE_HEADER_INFO_USE = \"USE\"", "modifier": "public static final", "original_string": "public static final String FILE_HEADER_INFO_USE = \"USE\";", "type": "String", "var_name": "FILE_HEADER_INFO_USE" }, { "declarator": "JSON_TYPE = \"JSON-TYPE\"", "modifier": "public static final", "original_string": "public static final String JSON_TYPE = \"JSON-TYPE\";", "type": "String", "var_name": "JSON_TYPE" }, { "declarator": "isResultComplete", "modifier": "private", "original_string": "private AtomicBoolean isResultComplete;", "type": "AtomicBoolean", "var_name": "isResultComplete" }, { "declarator": "s3Client", "modifier": "private", "original_string": "private AmazonS3 s3Client;", "type": "AmazonS3", "var_name": "s3Client" }, { "declarator": "result", "modifier": "private", "original_string": "private SelectObjectContentResult result;", "type": "SelectObjectContentResult", "var_name": "result" }, { "declarator": "resultInputStream", "modifier": "private", "original_string": "private InputStream resultInputStream;", "type": "InputStream", "var_name": "resultInputStream" }, { "declarator": "reader", "modifier": "private", "original_string": "private BufferedReader reader;", "type": "BufferedReader", "var_name": "reader" }, { "declarator": "lineReadCount", "modifier": "private", "original_string": "private int lineReadCount;", "type": "int", "var_name": "lineReadCount" }, { "declarator": "name", "modifier": "private", "original_string": "private URI name;", "type": "URI", "var_name": "name" } ], "file": "server/pxf-s3/src/main/java/org/greenplum/pxf/plugins/s3/S3SelectAccessor.java", "identifier": "S3SelectAccessor", "interfaces": "implements Accessor", "methods": [ { "class_method_signature": "S3SelectAccessor.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForRead()", "constructor": false, "full_signature": "@Override public boolean openForRead()", "identifier": "openForRead", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.readNextObject()", "constructor": false, "full_signature": "@Override public OneRow readNextObject()", "identifier": "readNextObject", "modifiers": "@Override public", "parameters": "()", "return": "OneRow", "signature": "OneRow readNextObject()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForRead()", "constructor": false, "full_signature": "@Override public void closeForRead()", "identifier": "closeForRead", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForRead()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.generateBaseCSVRequest(RequestContext context)", "constructor": false, "full_signature": " SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "identifier": "generateBaseCSVRequest", "modifiers": "", "parameters": "(RequestContext context)", "return": "SelectObjectContentRequest", "signature": "SelectObjectContentRequest generateBaseCSVRequest(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getOutputSerialization(RequestContext context)", "constructor": false, "full_signature": "private OutputSerialization getOutputSerialization(RequestContext context)", "identifier": "getOutputSerialization", "modifiers": "private", "parameters": "(RequestContext context)", "return": "OutputSerialization", "signature": "OutputSerialization getOutputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getInputSerialization(RequestContext context)", "constructor": false, "full_signature": " InputSerialization getInputSerialization(RequestContext context)", "identifier": "getInputSerialization", "modifiers": "", "parameters": "(RequestContext context)", "return": "InputSerialization", "signature": "InputSerialization getInputSerialization(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getJSONInput(RequestContext context)", "constructor": false, "full_signature": " JSONInput getJSONInput(RequestContext context)", "identifier": "getJSONInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "JSONInput", "signature": "JSONInput getJSONInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.getCSVInput(RequestContext context)", "constructor": false, "full_signature": " CSVInput getCSVInput(RequestContext context)", "identifier": "getCSVInput", "modifiers": "", "parameters": "(RequestContext context)", "return": "CSVInput", "signature": "CSVInput getCSVInput(RequestContext context)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.initS3Client()", "constructor": false, "full_signature": "private AmazonS3 initS3Client()", "identifier": "initS3Client", "modifiers": "private", "parameters": "()", "return": "AmazonS3", "signature": "AmazonS3 initS3Client()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.openForWrite()", "constructor": false, "full_signature": "@Override public boolean openForWrite()", "identifier": "openForWrite", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean openForWrite()", "testcase": false }, { "class_method_signature": "S3SelectAccessor.writeNextObject(OneRow onerow)", "constructor": false, "full_signature": "@Override public boolean writeNextObject(OneRow onerow)", "identifier": "writeNextObject", "modifiers": "@Override public", "parameters": "(OneRow onerow)", "return": "boolean", "signature": "boolean writeNextObject(OneRow onerow)", "testcase": false }, { "class_method_signature": "S3SelectAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "@Override\n public void closeForWrite() {\n throw new UnsupportedOperationException(\"S3 Select does not support writing\");\n }", "class_method_signature": "S3SelectAccessor.closeForWrite()", "constructor": false, "full_signature": "@Override public void closeForWrite()", "identifier": "closeForWrite", "invocations": [], "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void closeForWrite()", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_384
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "dbProduct = DbProduct.POSTGRES", "modifier": "private", "original_string": "private DbProduct dbProduct = DbProduct.POSTGRES;", "type": "DbProduct", "var_name": "dbProduct" }, { "declarator": "COL_RAW = \"col\"", "modifier": "private final", "original_string": "private final String COL_RAW = \"col\";", "type": "String", "var_name": "COL_RAW" }, { "declarator": "QUOTE = \"\\\"\"", "modifier": "private final", "original_string": "private final String QUOTE = \"\\\"\";", "type": "String", "var_name": "QUOTE" }, { "declarator": "COL = QUOTE + COL_RAW + QUOTE", "modifier": "private final", "original_string": "private final String COL = QUOTE + COL_RAW + QUOTE;", "type": "String", "var_name": "COL" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/partitioning/DatePartitionTest.java", "identifier": "DatePartitionTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testRightBounded() {\n DatePartition partition = new DatePartition(COL_RAW, null, LocalDate.parse(\"2000-01-01\"));\n String constraint = partition.toSqlConstraint(QUOTE, dbProduct);\n\n assertEquals(\n COL + \" < date'2000-01-01'\",\n constraint\n );\n }", "class_method_signature": "DatePartitionTest.testRightBounded()", "constructor": false, "full_signature": "@Test public void testRightBounded()", "identifier": "testRightBounded", "invocations": [ "parse", "toSqlConstraint", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testRightBounded()", "testcase": true }
{ "fields": [ { "declarator": "serialVersionUID = 0L", "modifier": "private static final", "original_string": "private static final long serialVersionUID = 0L;", "type": "long", "var_name": "serialVersionUID" }, { "declarator": "boundaries", "modifier": "private final", "original_string": "private final Date[] boundaries;", "type": "Date[]", "var_name": "boundaries" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/partitioning/DatePartition.java", "identifier": "DatePartition", "interfaces": "implements JdbcFragmentMetadata", "methods": [ { "class_method_signature": "DatePartition.DatePartition(String column, LocalDate start, LocalDate end)", "constructor": true, "full_signature": "public DatePartition(String column, LocalDate start, LocalDate end)", "identifier": "DatePartition", "modifiers": "public", "parameters": "(String column, LocalDate start, LocalDate end)", "return": "", "signature": " DatePartition(String column, LocalDate start, LocalDate end)", "testcase": false }, { "class_method_signature": "DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }, { "class_method_signature": "DatePartition.getBoundaries()", "constructor": false, "full_signature": "public Date[] getBoundaries()", "identifier": "getBoundaries", "modifiers": "public", "parameters": "()", "return": "Date[]", "signature": "Date[] getBoundaries()", "testcase": false } ], "superclass": "extends BasePartition" }
{ "body": "@Override\n public String toSqlConstraint(String quoteString, DbProduct dbProduct) {\n if (quoteString == null) {\n throw new RuntimeException(\"Quote string cannot be null\");\n }\n if (dbProduct == null) {\n throw new RuntimeException(String.format(\n \"DbProduct cannot be null for partitions of type '%s'\", PartitionType.DATE\n ));\n }\n\n return generateRangeConstraint(\n quoteString + column + quoteString,\n Stream.of(boundaries).map(b -> b == null ? null : dbProduct.wrapDate(b)).toArray(String[]::new)\n );\n }", "class_method_signature": "DatePartition.toSqlConstraint(String quoteString, DbProduct dbProduct)", "constructor": false, "full_signature": "@Override public String toSqlConstraint(String quoteString, DbProduct dbProduct)", "identifier": "toSqlConstraint", "invocations": [ "format", "generateRangeConstraint", "toArray", "map", "of", "wrapDate" ], "modifiers": "@Override public", "parameters": "(String quoteString, DbProduct dbProduct)", "return": "String", "signature": "String toSqlConstraint(String quoteString, DbProduct dbProduct)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_150
{ "fields": [ { "declarator": "mockContext", "modifier": "", "original_string": "RequestContext mockContext;", "type": "RequestContext", "var_name": "mockContext" }, { "declarator": "inputBuilder", "modifier": "", "original_string": "BridgeInputBuilder inputBuilder;", "type": "BridgeInputBuilder", "var_name": "inputBuilder" }, { "declarator": "inputStream", "modifier": "", "original_string": "DataInputStream inputStream;", "type": "DataInputStream", "var_name": "inputStream" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/BridgeInputBuilderTest.java", "identifier": "BridgeInputBuilderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n /*\n * Test the makeInput method: input > buffer size, no \\n\n */\n public void makeInputBigArrayNoNewLine() throws Exception {\n\n byte[] bigArray = new byte[2000];\n for (int i = 0; i < 2000; ++i) {\n bigArray[i] = (byte) (i % 10 + 60);\n }\n\n prepareInput(bigArray);\n\n List<OneField> record = inputBuilder.makeInput(inputStream);\n\n verifyRecord(record, bigArray);\n }", "class_method_signature": "BridgeInputBuilderTest.makeInputBigArrayNoNewLine()", "constructor": false, "full_signature": "@Test /* * Test the makeInput method: input > buffer size, no \\n */ public void makeInputBigArrayNoNewLine()", "identifier": "makeInputBigArrayNoNewLine", "invocations": [ "prepareInput", "makeInput", "verifyRecord" ], "modifiers": "@Test /* * Test the makeInput method: input > buffer size, no \\n */ public", "parameters": "()", "return": "void", "signature": "void makeInputBigArrayNoNewLine()", "testcase": true }
{ "fields": [ { "declarator": "protocolData", "modifier": "private final", "original_string": "private final RequestContext protocolData;", "type": "RequestContext", "var_name": "protocolData" }, { "declarator": "LOG = LogFactory.getLog(BridgeInputBuilder.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(BridgeInputBuilder.class);", "type": "Log", "var_name": "LOG" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/BridgeInputBuilder.java", "identifier": "BridgeInputBuilder", "interfaces": "", "methods": [ { "class_method_signature": "BridgeInputBuilder.BridgeInputBuilder(RequestContext protocolData)", "constructor": true, "full_signature": "public BridgeInputBuilder(RequestContext protocolData)", "identifier": "BridgeInputBuilder", "modifiers": "public", "parameters": "(RequestContext protocolData)", "return": "", "signature": " BridgeInputBuilder(RequestContext protocolData)", "testcase": false }, { "class_method_signature": "BridgeInputBuilder.makeInput(DataInput inputStream)", "constructor": false, "full_signature": "public List<OneField> makeInput(DataInput inputStream)", "identifier": "makeInput", "modifiers": "public", "parameters": "(DataInput inputStream)", "return": "List<OneField>", "signature": "List<OneField> makeInput(DataInput inputStream)", "testcase": false } ], "superclass": "" }
{ "body": "public List<OneField> makeInput(DataInput inputStream) throws Exception {\n if (protocolData.getOutputFormat() == OutputFormat.TEXT) {\n // Avoid copying the bytes from the inputStream directly. This\n // code used to use the Text class to read bytes until a line\n // delimiter was found. This would cause issues with wide rows that\n // had 1MB+, because the Text code grows the array to fit data, and\n // it does it inefficiently. We observed multiple calls to\n // System.arraycopy in the setCapacity method for every byte after\n // we exceeded the original buffer size. This caused terrible\n // performance in PXF, even when writing a single row to an external\n // system.\n return Collections.singletonList(new OneField(DataType.BYTEA.getOID(), inputStream));\n }\n\n GPDBWritable gpdbWritable = new GPDBWritable();\n gpdbWritable.readFields(inputStream);\n\n if (gpdbWritable.isEmpty()) {\n LOG.debug(\"Reached end of stream\");\n return null;\n }\n\n GPDBWritableMapper mapper = new GPDBWritableMapper(gpdbWritable);\n int[] colTypes = gpdbWritable.getColType();\n List<OneField> record = new LinkedList<>();\n for (int i = 0; i < colTypes.length; i++) {\n mapper.setDataType(colTypes[i]);\n record.add(new OneField(colTypes[i], mapper.getData(i)));\n }\n\n return record;\n }", "class_method_signature": "BridgeInputBuilder.makeInput(DataInput inputStream)", "constructor": false, "full_signature": "public List<OneField> makeInput(DataInput inputStream)", "identifier": "makeInput", "invocations": [ "getOutputFormat", "singletonList", "getOID", "readFields", "isEmpty", "debug", "getColType", "setDataType", "add", "getData" ], "modifiers": "public", "parameters": "(DataInput inputStream)", "return": "List<OneField>", "signature": "List<OneField> makeInput(DataInput inputStream)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_296
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "resolver", "modifier": "private", "original_string": "private ParquetResolver resolver;", "type": "ParquetResolver", "var_name": "resolver" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private MessageType schema;", "type": "MessageType", "var_name": "schema" }, { "declarator": "localTimestampString", "modifier": "private", "original_string": "private String localTimestampString;", "type": "String", "var_name": "localTimestampString" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/ParquetResolverTest.java", "identifier": "ParquetResolverTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n @SuppressWarnings(\"deprecation\")\n public void testGetFields_Primitive_RepeatedString() throws IOException {\n List<Type> columns = new ArrayList<>();\n columns.add(new PrimitiveType(Type.Repetition.REPEATED, PrimitiveTypeName.BINARY, \"myString\", OriginalType.UTF8));\n schema = new MessageType(\"TestProtobuf.StringArray\", columns);\n context.setMetadata(schema);\n context.setTupleDescription(getColumnDescriptorsFromSchema(schema));\n resolver.initialize(context);\n\n List<Group> groups = readParquetFile(\"proto-repeated-string.parquet\", 3, schema);\n List<OneField> fields;\n\n // row 0\n fields = assertRow(groups, 0, 1);\n assertEquals(DataType.TEXT.getOID(), fields.get(0).type);\n assertEquals(\"[\\\"hello\\\",\\\"world\\\"]\", fields.get(0).val);\n\n // row 1\n fields = assertRow(groups, 1, 1);\n assertEquals(DataType.TEXT.getOID(), fields.get(0).type);\n assertEquals(\"[\\\"good\\\",\\\"bye\\\"]\", fields.get(0).val);\n\n // row 2\n fields = assertRow(groups, 2, 1);\n assertEquals(DataType.TEXT.getOID(), fields.get(0).type);\n assertEquals(\"[\\\"one\\\",\\\"two\\\",\\\"three\\\"]\", fields.get(0).val);\n\n }", "class_method_signature": "ParquetResolverTest.testGetFields_Primitive_RepeatedString()", "constructor": false, "full_signature": "@Test @SuppressWarnings(\"deprecation\") public void testGetFields_Primitive_RepeatedString()", "identifier": "testGetFields_Primitive_RepeatedString", "invocations": [ "add", "setMetadata", "setTupleDescription", "getColumnDescriptorsFromSchema", "initialize", "readParquetFile", "assertRow", "assertEquals", "getOID", "get", "assertEquals", "get", "assertRow", "assertEquals", "getOID", "get", "assertEquals", "get", "assertRow", "assertEquals", "getOID", "get", "assertEquals", "get" ], "modifiers": "@Test @SuppressWarnings(\"deprecation\") public", "parameters": "()", "return": "void", "signature": "void testGetFields_Primitive_RepeatedString()", "testcase": true }
{ "fields": [ { "declarator": "TIMESTAMP_PATTERN = Pattern.compile(\"[+-]\\\\d{2}(:\\\\d{2})?$\")", "modifier": "public static final", "original_string": "public static final Pattern TIMESTAMP_PATTERN = Pattern.compile(\"[+-]\\\\d{2}(:\\\\d{2})?$\");", "type": "Pattern", "var_name": "TIMESTAMP_PATTERN" }, { "declarator": "schema", "modifier": "private", "original_string": "private MessageType schema;", "type": "MessageType", "var_name": "schema" }, { "declarator": "groupFactory", "modifier": "private", "original_string": "private SimpleGroupFactory groupFactory;", "type": "SimpleGroupFactory", "var_name": "groupFactory" }, { "declarator": "mapper = new ObjectMapper()", "modifier": "private final", "original_string": "private final ObjectMapper mapper = new ObjectMapper();", "type": "ObjectMapper", "var_name": "mapper" }, { "declarator": "columnDescriptors", "modifier": "private", "original_string": "private List<ColumnDescriptor> columnDescriptors;", "type": "List<ColumnDescriptor>", "var_name": "columnDescriptors" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/ParquetResolver.java", "identifier": "ParquetResolver", "interfaces": "implements Resolver", "methods": [ { "class_method_signature": "ParquetResolver.ParquetResolver()", "constructor": true, "full_signature": "public ParquetResolver()", "identifier": "ParquetResolver", "modifiers": "public", "parameters": "()", "return": "", "signature": " ParquetResolver()", "testcase": false }, { "class_method_signature": "ParquetResolver.ParquetResolver(ConfigurationFactory configurationFactory)", "constructor": true, "full_signature": " ParquetResolver(ConfigurationFactory configurationFactory)", "identifier": "ParquetResolver", "modifiers": "", "parameters": "(ConfigurationFactory configurationFactory)", "return": "", "signature": " ParquetResolver(ConfigurationFactory configurationFactory)", "testcase": false }, { "class_method_signature": "ParquetResolver.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "ParquetResolver.getFields(OneRow row)", "constructor": false, "full_signature": "@Override public List<OneField> getFields(OneRow row)", "identifier": "getFields", "modifiers": "@Override public", "parameters": "(OneRow row)", "return": "List<OneField>", "signature": "List<OneField> getFields(OneRow row)", "testcase": false }, { "class_method_signature": "ParquetResolver.setFields(List<OneField> record)", "constructor": false, "full_signature": "@Override public OneRow setFields(List<OneField> record)", "identifier": "setFields", "modifiers": "@Override public", "parameters": "(List<OneField> record)", "return": "OneRow", "signature": "OneRow setFields(List<OneField> record)", "testcase": false }, { "class_method_signature": "ParquetResolver.fillGroup(int index, OneField field, Group group, Type type)", "constructor": false, "full_signature": "private void fillGroup(int index, OneField field, Group group, Type type)", "identifier": "fillGroup", "modifiers": "private", "parameters": "(int index, OneField field, Group group, Type type)", "return": "void", "signature": "void fillGroup(int index, OneField field, Group group, Type type)", "testcase": false }, { "class_method_signature": "ParquetResolver.validateSchema()", "constructor": false, "full_signature": "private void validateSchema()", "identifier": "validateSchema", "modifiers": "private", "parameters": "()", "return": "void", "signature": "void validateSchema()", "testcase": false }, { "class_method_signature": "ParquetResolver.resolvePrimitive(Group group, int columnIndex, Type type, int level)", "constructor": false, "full_signature": "private OneField resolvePrimitive(Group group, int columnIndex, Type type, int level)", "identifier": "resolvePrimitive", "modifiers": "private", "parameters": "(Group group, int columnIndex, Type type, int level)", "return": "OneField", "signature": "OneField resolvePrimitive(Group group, int columnIndex, Type type, int level)", "testcase": false } ], "superclass": "extends BasePlugin" }
{ "body": "@Override\n public void initialize(RequestContext requestContext) {\n super.initialize(requestContext);\n this.columnDescriptors = context.getTupleDescription();\n }", "class_method_signature": "ParquetResolver.initialize(RequestContext requestContext)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext requestContext)", "identifier": "initialize", "invocations": [ "initialize", "getTupleDescription" ], "modifiers": "@Override public", "parameters": "(RequestContext requestContext)", "return": "void", "signature": "void initialize(RequestContext requestContext)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_279
{ "fields": [ { "declarator": "reader", "modifier": "", "original_string": "ChunkReader reader;", "type": "ChunkReader", "var_name": "reader" }, { "declarator": "mockStream", "modifier": "", "original_string": "DFSInputStream mockStream;", "type": "DFSInputStream", "var_name": "mockStream" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/ChunkReaderTest.java", "identifier": "ChunkReaderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void readChunk() throws Exception {\n\t\treader = new ChunkReader(mockStream);\n\t\twhen( mockStream.read( (byte [])Mockito.anyObject()) ).thenAnswer(new Answer<java.lang.Number>() {\n\t\t\t@Override\n\t\t\tpublic java.lang.Number answer(InvocationOnMock invocation) throws Throwable {\n\t\t\t\tbyte[] buf = (byte[]) invocation.getArguments()[0];\n\n\t\t\t\tbyte [] source = \"OneLine\\nTwoLine\\n\".getBytes();\n\t\t\t\tSystem.arraycopy(source, 0, buf, 0, source.length);\n\t\t\t\treturn new java.lang.Integer(source.length);\n\t\t\t}\n\t\t});\n\n\t\tChunkWritable out = new ChunkWritable();\n\t\tint maxBytesToConsume = 10; /* make readChunk return after reading the first \"chunk\": OneLine\\nTwoLine\\n */\n\t\t// read chunk\n\t\tassertEquals(\"OneLine\\nTwoLine\\n\".length()\n\t\t\t\t\t , reader.readChunk(out, maxBytesToConsume) );\n\t\tassertEquals(\"OneLine\\nTwoLine\\n\", new String(out.box) );\n }", "class_method_signature": "ChunkReaderTest.readChunk()", "constructor": false, "full_signature": "@Test public void readChunk()", "identifier": "readChunk", "invocations": [ "thenAnswer", "when", "read", "anyObject", "getArguments", "getBytes", "arraycopy", "assertEquals", "length", "readChunk", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void readChunk()", "testcase": true }
{ "fields": [ { "declarator": "DEFAULT_BUFFER_SIZE = 64 * 1024", "modifier": "public static final", "original_string": "public static final int DEFAULT_BUFFER_SIZE = 64 * 1024;", "type": "int", "var_name": "DEFAULT_BUFFER_SIZE" }, { "declarator": "bufferSize = DEFAULT_BUFFER_SIZE", "modifier": "private", "original_string": "private int bufferSize = DEFAULT_BUFFER_SIZE;", "type": "int", "var_name": "bufferSize" }, { "declarator": "in", "modifier": "private", "original_string": "private InputStream in;", "type": "InputStream", "var_name": "in" }, { "declarator": "buffer", "modifier": "private", "original_string": "private byte[] buffer;", "type": "byte[]", "var_name": "buffer" }, { "declarator": "bufferLength = 0", "modifier": "private", "original_string": "private int bufferLength = 0;", "type": "int", "var_name": "bufferLength" }, { "declarator": "bufferPosn = 0", "modifier": "private", "original_string": "private int bufferPosn = 0;", "type": "int", "var_name": "bufferPosn" }, { "declarator": "LF = '\\n'", "modifier": "private static final", "original_string": "private static final byte LF = '\\n';", "type": "byte", "var_name": "LF" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/ChunkReader.java", "identifier": "ChunkReader", "interfaces": "implements Closeable", "methods": [ { "class_method_signature": "ChunkReader.ChunkReader(InputStream in)", "constructor": true, "full_signature": "public ChunkReader(InputStream in)", "identifier": "ChunkReader", "modifiers": "public", "parameters": "(InputStream in)", "return": "", "signature": " ChunkReader(InputStream in)", "testcase": false }, { "class_method_signature": "ChunkReader.close()", "constructor": false, "full_signature": "@Override public void close()", "identifier": "close", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void close()", "testcase": false }, { "class_method_signature": "ChunkReader.readChunk(Writable str, int maxBytesToConsume)", "constructor": false, "full_signature": "public int readChunk(Writable str, int maxBytesToConsume)", "identifier": "readChunk", "modifiers": "public", "parameters": "(Writable str, int maxBytesToConsume)", "return": "int", "signature": "int readChunk(Writable str, int maxBytesToConsume)", "testcase": false }, { "class_method_signature": "ChunkReader.readLine(Writable str, int maxBytesToConsume)", "constructor": false, "full_signature": "public int readLine(Writable str, int maxBytesToConsume)", "identifier": "readLine", "modifiers": "public", "parameters": "(Writable str, int maxBytesToConsume)", "return": "int", "signature": "int readLine(Writable str, int maxBytesToConsume)", "testcase": false } ], "superclass": "" }
{ "body": "public int readChunk(Writable str, int maxBytesToConsume) throws IOException\n {\n ChunkWritable cw = (ChunkWritable) str;\n List<Node> list = new LinkedList<Node>();\n\n long bytesConsumed = 0;\n\n do {\n if (bufferLength > 0) {\n int remaining = bufferLength - bufferPosn;\n Node nd = new Node();\n nd.slice = new byte[remaining];\n nd.len = remaining;\n System.arraycopy(buffer, bufferPosn, nd.slice, 0, nd.len);\n list.add(nd);\n bytesConsumed += nd.len;\n } else {\n Node nd = new Node();\n nd.slice = new byte[buffer.length];\n nd.len = in.read(nd.slice);\n if (nd.len <= 0) {\n break; // EOF\n }\n bytesConsumed += nd.len;\n list.add(nd);\n }\n\n bufferLength = bufferPosn = 0;\n\n } while (bytesConsumed < maxBytesToConsume);\n\n if (list.size() > 0) {\n cw.box = new byte[(int) bytesConsumed];\n int pos = 0;\n for (int i = 0; i < list.size(); i++) {\n Node n = list.get(i);\n System.arraycopy(n.slice, 0, cw.box, pos, n.len);\n pos += n.len;\n }\n }\n\n return (int) bytesConsumed;\n }", "class_method_signature": "ChunkReader.readChunk(Writable str, int maxBytesToConsume)", "constructor": false, "full_signature": "public int readChunk(Writable str, int maxBytesToConsume)", "identifier": "readChunk", "invocations": [ "arraycopy", "add", "read", "add", "size", "size", "get", "arraycopy" ], "modifiers": "public", "parameters": "(Writable str, int maxBytesToConsume)", "return": "int", "signature": "int readChunk(Writable str, int maxBytesToConsume)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_98
{ "fields": [ { "declarator": "PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_USER_IMPERSONATION" }, { "declarator": "PROPERTY_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\";", "type": "String", "var_name": "PROPERTY_KEY_SERVICE_PRINCIPAL" }, { "declarator": "PROPERTY_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\";", "type": "String", "var_name": "PROPERTY_KEY_SERVICE_KEYTAB" }, { "declarator": "PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_KDC = \"java.security.krb5.kdc\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_KDC" }, { "declarator": "PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_KERBEROS_REALM = \"java.security.krb5.realm\";", "type": "String", "var_name": "PROPERTY_KEY_KERBEROS_REALM" }, { "declarator": "userImpersonationEnabled", "modifier": "private static", "original_string": "private static String userImpersonationEnabled;", "type": "String", "var_name": "userImpersonationEnabled" }, { "declarator": "kerberosPrincipal", "modifier": "private static", "original_string": "private static String kerberosPrincipal;", "type": "String", "var_name": "kerberosPrincipal" }, { "declarator": "kerberosKeytab", "modifier": "private static", "original_string": "private static String kerberosKeytab;", "type": "String", "var_name": "kerberosKeytab" }, { "declarator": "kdcDefault", "modifier": "private static", "original_string": "private static String kdcDefault;", "type": "String", "var_name": "kdcDefault" }, { "declarator": "realmDefault", "modifier": "private static", "original_string": "private static String realmDefault;", "type": "String", "var_name": "realmDefault" }, { "declarator": "hostname", "modifier": "private static final", "original_string": "private static final String hostname;", "type": "String", "var_name": "hostname" }, { "declarator": "RESOLVED_PRINCIPAL", "modifier": "private static final", "original_string": "private static final String RESOLVED_PRINCIPAL;", "type": "String", "var_name": "RESOLVED_PRINCIPAL" }, { "declarator": "secureLogin", "modifier": "private", "original_string": "private SecureLogin secureLogin;", "type": "SecureLogin", "var_name": "secureLogin" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "expectedLoginSession", "modifier": "private", "original_string": "private LoginSession expectedLoginSession;", "type": "LoginSession", "var_name": "expectedLoginSession" }, { "declarator": "expectedUGI", "modifier": "private", "original_string": "private UserGroupInformation expectedUGI;", "type": "UserGroupInformation", "var_name": "expectedUGI" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/security/SecureLoginTest.java", "identifier": "SecureLoginTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGlobalImpersonationPropertyTrue() {\n System.setProperty(PROPERTY_KEY_USER_IMPERSONATION, \"true\");\n assertTrue(secureLogin.isUserImpersonationEnabled(configuration));\n }", "class_method_signature": "SecureLoginTest.testGlobalImpersonationPropertyTrue()", "constructor": false, "full_signature": "@Test public void testGlobalImpersonationPropertyTrue()", "identifier": "testGlobalImpersonationPropertyTrue", "invocations": [ "setProperty", "assertTrue", "isUserImpersonationEnabled" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGlobalImpersonationPropertyTrue()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(SecureLogin.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(SecureLogin.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "CONFIG_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_PRINCIPAL = \"pxf.service.kerberos.principal\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_PRINCIPAL" }, { "declarator": "CONFIG_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_KEYTAB = \"pxf.service.kerberos.keytab\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_KEYTAB" }, { "declarator": "CONFIG_KEY_SERVICE_USER_IMPERSONATION = \"pxf.service.user.impersonation\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_USER_IMPERSONATION = \"pxf.service.user.impersonation\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_USER_IMPERSONATION" }, { "declarator": "CONFIG_KEY_SERVICE_USER_NAME = \"pxf.service.user.name\"", "modifier": "public static final", "original_string": "public static final String CONFIG_KEY_SERVICE_USER_NAME = \"pxf.service.user.name\";", "type": "String", "var_name": "CONFIG_KEY_SERVICE_USER_NAME" }, { "declarator": "PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_USER_IMPERSONATION = \"pxf.service.user.impersonation.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_USER_IMPERSONATION" }, { "declarator": "loginMap = new HashMap<>()", "modifier": "private static final", "original_string": "private static final Map<String, LoginSession> loginMap = new HashMap<>();", "type": "Map<String, LoginSession>", "var_name": "loginMap" }, { "declarator": "instance = new SecureLogin()", "modifier": "private static final", "original_string": "private static final SecureLogin instance = new SecureLogin();", "type": "SecureLogin", "var_name": "instance" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/security/SecureLogin.java", "identifier": "SecureLogin", "interfaces": "", "methods": [ { "class_method_signature": "SecureLogin.SecureLogin()", "constructor": true, "full_signature": "private SecureLogin()", "identifier": "SecureLogin", "modifiers": "private", "parameters": "()", "return": "", "signature": " SecureLogin()", "testcase": false }, { "class_method_signature": "SecureLogin.getInstance()", "constructor": false, "full_signature": "public static SecureLogin getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "SecureLogin", "signature": "SecureLogin getInstance()", "testcase": false }, { "class_method_signature": "SecureLogin.getLoginUser(RequestContext context, Configuration configuration)", "constructor": false, "full_signature": "public UserGroupInformation getLoginUser(RequestContext context, Configuration configuration)", "identifier": "getLoginUser", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration)", "return": "UserGroupInformation", "signature": "UserGroupInformation getLoginUser(RequestContext context, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getLoginUser(String serverName, String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "public UserGroupInformation getLoginUser(String serverName, String configDirectory, Configuration configuration)", "identifier": "getLoginUser", "modifiers": "public", "parameters": "(String serverName, String configDirectory, Configuration configuration)", "return": "UserGroupInformation", "signature": "UserGroupInformation getLoginUser(String serverName, String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.login(String serverName, String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "private LoginSession login(String serverName, String configDirectory, Configuration configuration)", "identifier": "login", "modifiers": "private", "parameters": "(String serverName, String configDirectory, Configuration configuration)", "return": "LoginSession", "signature": "LoginSession login(String serverName, String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.isUserImpersonationEnabled(Configuration configuration)", "constructor": false, "full_signature": "public boolean isUserImpersonationEnabled(Configuration configuration)", "identifier": "isUserImpersonationEnabled", "modifiers": "public", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isUserImpersonationEnabled(Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "constructor": false, "full_signature": "private LoginSession getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "identifier": "getServerLoginSession", "modifiers": "private", "parameters": "(final String serverName, final String configDirectory, Configuration configuration)", "return": "LoginSession", "signature": "LoginSession getServerLoginSession(final String serverName, final String configDirectory, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServicePrincipal(String serverName, Configuration configuration)", "constructor": false, "full_signature": " String getServicePrincipal(String serverName, Configuration configuration)", "identifier": "getServicePrincipal", "modifiers": "", "parameters": "(String serverName, Configuration configuration)", "return": "String", "signature": "String getServicePrincipal(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getServiceKeytab(String serverName, Configuration configuration)", "constructor": false, "full_signature": " String getServiceKeytab(String serverName, Configuration configuration)", "identifier": "getServiceKeytab", "modifiers": "", "parameters": "(String serverName, Configuration configuration)", "return": "String", "signature": "String getServiceKeytab(String serverName, Configuration configuration)", "testcase": false }, { "class_method_signature": "SecureLogin.getLocalHostName(@Nullable Configuration conf)", "constructor": false, "full_signature": "private String getLocalHostName(@Nullable Configuration conf)", "identifier": "getLocalHostName", "modifiers": "private", "parameters": "(@Nullable Configuration conf)", "return": "String", "signature": "String getLocalHostName(@Nullable Configuration conf)", "testcase": false }, { "class_method_signature": "SecureLogin.reset()", "constructor": false, "full_signature": "static void reset()", "identifier": "reset", "modifiers": "static", "parameters": "()", "return": "void", "signature": "void reset()", "testcase": false }, { "class_method_signature": "SecureLogin.getCache()", "constructor": false, "full_signature": "static Map<String, LoginSession> getCache()", "identifier": "getCache", "modifiers": "static", "parameters": "()", "return": "Map<String, LoginSession>", "signature": "Map<String, LoginSession> getCache()", "testcase": false }, { "class_method_signature": "SecureLogin.addToCache(String server, LoginSession session)", "constructor": false, "full_signature": "static void addToCache(String server, LoginSession session)", "identifier": "addToCache", "modifiers": "static", "parameters": "(String server, LoginSession session)", "return": "void", "signature": "void addToCache(String server, LoginSession session)", "testcase": false } ], "superclass": "" }
{ "body": "public boolean isUserImpersonationEnabled(Configuration configuration) {\n String valueFromUserImpersonationOnServer = configuration.get(SecureLogin.CONFIG_KEY_SERVICE_USER_IMPERSONATION, System.getProperty(PROPERTY_KEY_USER_IMPERSONATION, \"false\"));\n return StringUtils.equalsIgnoreCase(valueFromUserImpersonationOnServer, \"true\");\n }", "class_method_signature": "SecureLogin.isUserImpersonationEnabled(Configuration configuration)", "constructor": false, "full_signature": "public boolean isUserImpersonationEnabled(Configuration configuration)", "identifier": "isUserImpersonationEnabled", "invocations": [ "get", "getProperty", "equalsIgnoreCase" ], "modifiers": "public", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isUserImpersonationEnabled(Configuration configuration)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_77
{ "fields": [ { "declarator": "PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\"", "modifier": "private", "original_string": "private String PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_FRAGMENTER_CACHE" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/utilities/UtilitiesTest.java", "identifier": "UtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void createAnyInstanceOldPackageName() throws Exception {\n\n RequestContext metaData = mock(RequestContext.class);\n String className = \"com.pivotal.pxf.Lucy\";\n\n try {\n Utilities.createAnyInstance(RequestContext.class,\n className, metaData);\n fail(\"creating an instance should fail because the class doesn't exist in classpath\");\n } catch (Exception e) {\n assertEquals(e.getClass(), Exception.class);\n assertEquals(\n e.getMessage(),\n \"Class \" + className + \" does not appear in classpath. \"\n + \"Plugins provided by PXF must start with \\\"org.greenplum.pxf\\\"\");\n }\n }", "class_method_signature": "UtilitiesTest.createAnyInstanceOldPackageName()", "constructor": false, "full_signature": "@Test public void createAnyInstanceOldPackageName()", "identifier": "createAnyInstanceOldPackageName", "invocations": [ "mock", "createAnyInstance", "fail", "assertEquals", "getClass", "assertEquals", "getMessage" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void createAnyInstanceOldPackageName()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(Utilities.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(Utilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\"", "modifier": "private static final", "original_string": "private static final String PROPERTY_KEY_FRAGMENTER_CACHE = \"pxf.service.fragmenter.cache.enabled\";", "type": "String", "var_name": "PROPERTY_KEY_FRAGMENTER_CACHE" }, { "declarator": "PROHIBITED_CHARS = new char[]{'/', '\\\\', '.', ' ', ',', ';'}", "modifier": "private static final", "original_string": "private static final char[] PROHIBITED_CHARS = new char[]{'/', '\\\\', '.', ' ', ',', ';'};", "type": "char[]", "var_name": "PROHIBITED_CHARS" }, { "declarator": "HOSTS = new String[]{\"localhost\"}", "modifier": "private static final", "original_string": "private static final String[] HOSTS = new String[]{\"localhost\"};", "type": "String[]", "var_name": "HOSTS" }, { "declarator": "SCHEME_PATTERN = Pattern.compile(\"^((([^:/?#]+):)?//)?\")", "modifier": "public static final", "original_string": "public static final Pattern SCHEME_PATTERN = Pattern.compile(\"^((([^:/?#]+):)?//)?\");", "type": "Pattern", "var_name": "SCHEME_PATTERN" }, { "declarator": "NON_HOSTNAME_CHARACTERS = Pattern.compile(\"[:/?#]\")", "modifier": "public static final", "original_string": "public static final Pattern NON_HOSTNAME_CHARACTERS = Pattern.compile(\"[:/?#]\");", "type": "Pattern", "var_name": "NON_HOSTNAME_CHARACTERS" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/utilities/Utilities.java", "identifier": "Utilities", "interfaces": "", "methods": [ { "class_method_signature": "Utilities.parseBase64(String encoded, String paramName)", "constructor": false, "full_signature": "public static byte[] parseBase64(String encoded, String paramName)", "identifier": "parseBase64", "modifiers": "public static", "parameters": "(String encoded, String paramName)", "return": "byte[]", "signature": "byte[] parseBase64(String encoded, String paramName)", "testcase": false }, { "class_method_signature": "Utilities.isValidDirectoryName(String name)", "constructor": false, "full_signature": "public static boolean isValidDirectoryName(String name)", "identifier": "isValidDirectoryName", "modifiers": "public static", "parameters": "(String name)", "return": "boolean", "signature": "boolean isValidDirectoryName(String name)", "testcase": false }, { "class_method_signature": "Utilities.isValidRestrictedDirectoryName(String name)", "constructor": false, "full_signature": "public static boolean isValidRestrictedDirectoryName(String name)", "identifier": "isValidRestrictedDirectoryName", "modifiers": "public static", "parameters": "(String name)", "return": "boolean", "signature": "boolean isValidRestrictedDirectoryName(String name)", "testcase": false }, { "class_method_signature": "Utilities.isValidRestrictedDirectoryName(String name, boolean checkForProhibitedChars)", "constructor": false, "full_signature": "private static boolean isValidRestrictedDirectoryName(String name, boolean checkForProhibitedChars)", "identifier": "isValidRestrictedDirectoryName", "modifiers": "private static", "parameters": "(String name, boolean checkForProhibitedChars)", "return": "boolean", "signature": "boolean isValidRestrictedDirectoryName(String name, boolean checkForProhibitedChars)", "testcase": false }, { "class_method_signature": "Utilities.createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "constructor": false, "full_signature": "public static Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "identifier": "createAnyInstance", "modifiers": "public static", "parameters": "(Class<?> confClass,\n String className, RequestContext metaData)", "return": "Object", "signature": "Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "testcase": false }, { "class_method_signature": "Utilities.createAnyInstance(String className)", "constructor": false, "full_signature": "public static Object createAnyInstance(String className)", "identifier": "createAnyInstance", "modifiers": "public static", "parameters": "(String className)", "return": "Object", "signature": "Object createAnyInstance(String className)", "testcase": false }, { "class_method_signature": "Utilities.instantiate(Constructor<?> con, Object... args)", "constructor": false, "full_signature": "private static Object instantiate(Constructor<?> con, Object... args)", "identifier": "instantiate", "modifiers": "private static", "parameters": "(Constructor<?> con, Object... args)", "return": "Object", "signature": "Object instantiate(Constructor<?> con, Object... args)", "testcase": false }, { "class_method_signature": "Utilities.byteArrayToOctalString(byte[] bytes, StringBuilder sb)", "constructor": false, "full_signature": "public static void byteArrayToOctalString(byte[] bytes, StringBuilder sb)", "identifier": "byteArrayToOctalString", "modifiers": "public static", "parameters": "(byte[] bytes, StringBuilder sb)", "return": "void", "signature": "void byteArrayToOctalString(byte[] bytes, StringBuilder sb)", "testcase": false }, { "class_method_signature": "Utilities.maskNonPrintables(String input)", "constructor": false, "full_signature": "public static String maskNonPrintables(String input)", "identifier": "maskNonPrintables", "modifiers": "public static", "parameters": "(String input)", "return": "String", "signature": "String maskNonPrintables(String input)", "testcase": false }, { "class_method_signature": "Utilities.parseFragmentMetadata(RequestContext context)", "constructor": false, "full_signature": "public static FragmentMetadata parseFragmentMetadata(RequestContext context)", "identifier": "parseFragmentMetadata", "modifiers": "public static", "parameters": "(RequestContext context)", "return": "FragmentMetadata", "signature": "FragmentMetadata parseFragmentMetadata(RequestContext context)", "testcase": false }, { "class_method_signature": "Utilities.aggregateOptimizationsSupported(RequestContext requestContext)", "constructor": false, "full_signature": "public static boolean aggregateOptimizationsSupported(RequestContext requestContext)", "identifier": "aggregateOptimizationsSupported", "modifiers": "public static", "parameters": "(RequestContext requestContext)", "return": "boolean", "signature": "boolean aggregateOptimizationsSupported(RequestContext requestContext)", "testcase": false }, { "class_method_signature": "Utilities.implementsInterface(String className, Class<?> iface)", "constructor": false, "full_signature": "public static boolean implementsInterface(String className, Class<?> iface)", "identifier": "implementsInterface", "modifiers": "public static", "parameters": "(String className, Class<?> iface)", "return": "boolean", "signature": "boolean implementsInterface(String className, Class<?> iface)", "testcase": false }, { "class_method_signature": "Utilities.isFragmenterCacheEnabled()", "constructor": false, "full_signature": "public static boolean isFragmenterCacheEnabled()", "identifier": "isFragmenterCacheEnabled", "modifiers": "public static", "parameters": "()", "return": "boolean", "signature": "boolean isFragmenterCacheEnabled()", "testcase": false }, { "class_method_signature": "Utilities.absoluteDataPath(String dataSource)", "constructor": false, "full_signature": "public static String absoluteDataPath(String dataSource)", "identifier": "absoluteDataPath", "modifiers": "public static", "parameters": "(String dataSource)", "return": "String", "signature": "String absoluteDataPath(String dataSource)", "testcase": false }, { "class_method_signature": "Utilities.isSecurityEnabled(Configuration configuration)", "constructor": false, "full_signature": "public static boolean isSecurityEnabled(Configuration configuration)", "identifier": "isSecurityEnabled", "modifiers": "public static", "parameters": "(Configuration configuration)", "return": "boolean", "signature": "boolean isSecurityEnabled(Configuration configuration)", "testcase": false }, { "class_method_signature": "Utilities.rightTrimWhiteSpace(String s)", "constructor": false, "full_signature": "public static String rightTrimWhiteSpace(String s)", "identifier": "rightTrimWhiteSpace", "modifiers": "public static", "parameters": "(String s)", "return": "String", "signature": "String rightTrimWhiteSpace(String s)", "testcase": false }, { "class_method_signature": "Utilities.getHost(String uri)", "constructor": false, "full_signature": "public static String getHost(String uri)", "identifier": "getHost", "modifiers": "public static", "parameters": "(String uri)", "return": "String", "signature": "String getHost(String uri)", "testcase": false } ], "superclass": "" }
{ "body": "public static Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)\n throws Exception {\n\n Class<?> cls;\n try {\n cls = Class.forName(className);\n } catch (ClassNotFoundException e) {\n /* In case the class name uses the older and unsupported \"com.pivotal.pxf\"\n * package name, recommend using the new package \"org.greenplum.pxf\"\n */\n if (className.startsWith(\"com.pivotal.pxf\")) {\n throw new Exception(\n \"Class \"\n + className\n + \" does not appear in classpath. \"\n + \"Plugins provided by PXF must start with \\\"org.greenplum.pxf\\\"\",\n e.getCause());\n } else {\n throw e;\n }\n }\n\n Constructor<?> con = cls.getConstructor(confClass);\n\n return instantiate(con, metaData);\n }", "class_method_signature": "Utilities.createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "constructor": false, "full_signature": "public static Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "identifier": "createAnyInstance", "invocations": [ "forName", "startsWith", "getCause", "getConstructor", "instantiate" ], "modifiers": "public static", "parameters": "(Class<?> confClass,\n String className, RequestContext metaData)", "return": "Object", "signature": "Object createAnyInstance(Class<?> confClass,\n String className, RequestContext metaData)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_202
{ "fields": [ { "declarator": "parameters", "modifier": "private", "original_string": "private MultivaluedMap<String, String> parameters;", "type": "MultivaluedMap<String, String>", "var_name": "parameters" }, { "declarator": "parser", "modifier": "private", "original_string": "private HttpRequestParser parser;", "type": "HttpRequestParser", "var_name": "parser" }, { "declarator": "mockRequestHeaders", "modifier": "@Mock\n private", "original_string": "@Mock\n private ContainerRequest mockRequestHeaders;", "type": "ContainerRequest", "var_name": "mockRequestHeaders" }, { "declarator": "mockPluginConf", "modifier": "@Mock\n private", "original_string": "@Mock\n private PluginConf mockPluginConf;", "type": "PluginConf", "var_name": "mockPluginConf" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/HttpRequestParserTest.java", "identifier": "HttpRequestParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getFragmentMetadataNull() {\n parameters.remove(\"X-GP-FRAGMENT-METADATA\");\n RequestContext requestContext = parser.parseRequest(mockRequestHeaders, RequestType.FRAGMENTER);\n assertNull(requestContext.getFragmentMetadata());\n }", "class_method_signature": "HttpRequestParserTest.getFragmentMetadataNull()", "constructor": false, "full_signature": "@Test public void getFragmentMetadataNull()", "identifier": "getFragmentMetadataNull", "invocations": [ "remove", "parseRequest", "assertNull", "getFragmentMetadata" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getFragmentMetadataNull()", "testcase": true }
{ "fields": [ { "declarator": "TRUE_LCASE = \"true\"", "modifier": "private static final", "original_string": "private static final String TRUE_LCASE = \"true\";", "type": "String", "var_name": "TRUE_LCASE" }, { "declarator": "FALSE_LCASE = \"false\"", "modifier": "private static final", "original_string": "private static final String FALSE_LCASE = \"false\";", "type": "String", "var_name": "FALSE_LCASE" }, { "declarator": "LOG = LoggerFactory.getLogger(HttpRequestParser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpRequestParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "instance = new HttpRequestParser()", "modifier": "private static final", "original_string": "private static final HttpRequestParser instance = new HttpRequestParser();", "type": "HttpRequestParser", "var_name": "instance" }, { "declarator": "PROFILE_SCHEME = \"PROFILE-SCHEME\"", "modifier": "private static final", "original_string": "private static final String PROFILE_SCHEME = \"PROFILE-SCHEME\";", "type": "String", "var_name": "PROFILE_SCHEME" }, { "declarator": "pluginConf", "modifier": "private", "original_string": "private PluginConf pluginConf;", "type": "PluginConf", "var_name": "pluginConf" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/HttpRequestParser.java", "identifier": "HttpRequestParser", "interfaces": "implements RequestParser<HttpHeaders>", "methods": [ { "class_method_signature": "HttpRequestParser.HttpRequestParser()", "constructor": true, "full_signature": "public HttpRequestParser()", "identifier": "HttpRequestParser", "modifiers": "public", "parameters": "()", "return": "", "signature": " HttpRequestParser()", "testcase": false }, { "class_method_signature": "HttpRequestParser.HttpRequestParser(PluginConf pluginConf)", "constructor": true, "full_signature": " HttpRequestParser(PluginConf pluginConf)", "identifier": "HttpRequestParser", "modifiers": "", "parameters": "(PluginConf pluginConf)", "return": "", "signature": " HttpRequestParser(PluginConf pluginConf)", "testcase": false }, { "class_method_signature": "HttpRequestParser.getInstance()", "constructor": false, "full_signature": "public static HttpRequestParser getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "HttpRequestParser", "signature": "HttpRequestParser getInstance()", "testcase": false }, { "class_method_signature": "HttpRequestParser.protocolViolation(String property)", "constructor": false, "full_signature": "private static void protocolViolation(String property)", "identifier": "protocolViolation", "modifiers": "private static", "parameters": "(String property)", "return": "void", "signature": "void protocolViolation(String property)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseGreenplumCSV(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseGreenplumCSV(RequestMap params, RequestContext context)", "identifier": "parseGreenplumCSV", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseGreenplumCSV(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.addProfilePlugins(String profile, RequestMap params)", "constructor": false, "full_signature": "private void addProfilePlugins(String profile, RequestMap params)", "identifier": "addProfilePlugins", "modifiers": "private", "parameters": "(String profile, RequestMap params)", "return": "void", "signature": "void addProfilePlugins(String profile, RequestMap params)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseBooleanValue(String threadSafeStr)", "constructor": false, "full_signature": "private boolean parseBooleanValue(String threadSafeStr)", "identifier": "parseBooleanValue", "modifiers": "private", "parameters": "(String threadSafeStr)", "return": "boolean", "signature": "boolean parseBooleanValue(String threadSafeStr)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTupleDescription(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseTupleDescription(RequestMap params, RequestContext context)", "identifier": "parseTupleDescription", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseTupleDescription(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTypeMods(RequestMap params, int columnIndex)", "constructor": false, "full_signature": "private Integer[] parseTypeMods(RequestMap params, int columnIndex)", "identifier": "parseTypeMods", "modifiers": "private", "parameters": "(RequestMap params, int columnIndex)", "return": "Integer[]", "signature": "Integer[] parseTypeMods(RequestMap params, int columnIndex)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parsePositiveIntOrError(String s, String propName)", "constructor": false, "full_signature": "private int parsePositiveIntOrError(String s, String propName)", "identifier": "parsePositiveIntOrError", "modifiers": "private", "parameters": "(String s, String propName)", "return": "int", "signature": "int parsePositiveIntOrError(String s, String propName)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType) {\n\n RequestMap params = new RequestMap(request.getRequestHeaders());\n\n if (LOG.isDebugEnabled()) {\n // Logging only keys to prevent sensitive data to be logged\n LOG.debug(\"Parsing request parameters: \" + params.keySet());\n }\n\n // build new instance of RequestContext and fill it with parsed values\n RequestContext context = new RequestContext();\n\n // whether we are in a fragmenter, read_bridge, or write_bridge scenario\n context.setRequestType(requestType);\n\n // first of all, set profile and enrich parameters with information from specified profile\n String profile = params.removeUserProperty(\"PROFILE\");\n context.setProfile(profile);\n addProfilePlugins(profile, params);\n\n // Ext table uses system property FORMAT for wire serialization format\n String wireFormat = params.removeProperty(\"FORMAT\");\n context.setOutputFormat(OutputFormat.valueOf(wireFormat));\n\n // FDW uses user property FORMAT to indicate format of data\n String format = params.removeUserProperty(\"FORMAT\");\n format = StringUtils.isNotBlank(format) ? format : context.inferFormatName();\n context.setFormat(format);\n\n context.setAccessor(params.removeUserProperty(\"ACCESSOR\"));\n context.setAggType(EnumAggregationType.getAggregationType(params.removeOptionalProperty(\"AGG-TYPE\")));\n\n /*\n * Some resources don't require a fragment, hence the list can be empty.\n */\n String fragmentStr = params.removeOptionalProperty(\"DATA-FRAGMENT\");\n if (StringUtils.isNotBlank(fragmentStr)) {\n context.setDataFragment(Integer.parseInt(fragmentStr));\n }\n\n context.setDataSource(params.removeProperty(\"DATA-DIR\"));\n\n String filterString = params.removeOptionalProperty(\"FILTER\");\n String hasFilter = params.removeProperty(\"HAS-FILTER\");\n if (filterString != null) {\n context.setFilterString(filterString);\n } else if (\"1\".equals(hasFilter)) {\n LOG.info(\"Original query has filter, but it was not propagated to PXF\");\n }\n\n context.setFragmenter(params.removeUserProperty(\"FRAGMENTER\"));\n\n String fragmentIndexStr = params.removeOptionalProperty(\"FRAGMENT-INDEX\");\n if (StringUtils.isNotBlank(fragmentIndexStr)) {\n context.setFragmentIndex(Integer.parseInt(fragmentIndexStr));\n }\n\n String encodedFragmentMetadata = params.removeOptionalProperty(\"FRAGMENT-METADATA\");\n context.setFragmentMetadata(Utilities.parseBase64(encodedFragmentMetadata, \"Fragment metadata information\"));\n context.setHost(params.removeProperty(\"URL-HOST\"));\n context.setMetadata(params.removeUserProperty(\"METADATA\"));\n context.setPort(params.removeIntProperty(\"URL-PORT\"));\n context.setProfileScheme(params.removeUserProperty(PROFILE_SCHEME));\n context.setProtocol(params.removeUserProperty(\"PROTOCOL\"));\n context.setRemoteLogin(params.removeOptionalProperty(\"REMOTE-USER\"));\n context.setRemoteSecret(params.removeOptionalProperty(\"REMOTE-PASS\"));\n context.setResolver(params.removeUserProperty(\"RESOLVER\"));\n context.setSegmentId(params.removeIntProperty(\"SEGMENT-ID\"));\n context.setServerName(params.removeUserProperty(\"SERVER\"));\n\n // An optional CONFIG value specifies the name of the server\n // configuration directory, if not provided the config is the server name\n String config = params.removeUserProperty(\"CONFIG\");\n context.setConfig(StringUtils.isNotBlank(config) ? config : context.getServerName());\n\n String maxFrags = params.removeUserProperty(\"STATS-MAX-FRAGMENTS\");\n if (!StringUtils.isBlank(maxFrags)) {\n context.setStatsMaxFragments(Integer.parseInt(maxFrags));\n }\n\n String sampleRatioStr = params.removeUserProperty(\"STATS-SAMPLE-RATIO\");\n if (!StringUtils.isBlank(sampleRatioStr)) {\n context.setStatsSampleRatio(Float.parseFloat(sampleRatioStr));\n }\n\n context.setTotalSegments(params.removeIntProperty(\"SEGMENT-COUNT\"));\n context.setTransactionId(params.removeProperty(\"XID\"));\n\n // parse tuple description\n parseTupleDescription(params, context);\n\n if (context.getOutputFormat() == OutputFormat.TEXT) {\n // parse CSV format information\n parseGreenplumCSV(params, context);\n\n // Only single column tables support 'OFF' delimiter\n if (context.getTupleDescription().size() != 1 && context.getGreenplumCSV().getDelimiter() == null) {\n throw new IllegalArgumentException(String.format(\"using no delimiter is only possible for a single column table. %d columns found\", context.getTupleDescription().size()));\n }\n }\n\n context.setUser(params.removeProperty(\"USER\"));\n\n String encodedFragmentUserData = params.removeOptionalProperty(\"FRAGMENT-USER-DATA\");\n context.setUserData(Utilities.parseBase64(encodedFragmentUserData, \"Fragment user data\"));\n\n // Store alignment for global use as a system property\n System.setProperty(\"greenplum.alignment\", params.removeProperty(\"ALIGNMENT\"));\n\n Map<String, String> optionMappings = null;\n\n // prepare addition configuration properties if profile was specified\n if (StringUtils.isNotBlank(profile)) {\n optionMappings = pluginConf.getOptionMappings(profile);\n }\n\n // use empty map for convenience instead of null\n if (optionMappings == null) {\n optionMappings = Collections.emptyMap();\n }\n\n Map<String, String> additionalConfigProps = new HashMap<>();\n\n // Iterate over the remaining properties\n // we clone the keyset to prevent concurrent modification exceptions\n List<String> paramNames = new ArrayList<>(params.keySet());\n for (String param : paramNames) {\n if (StringUtils.startsWithIgnoreCase(param, RequestMap.USER_PROP_PREFIX)) {\n // Add all left-over user properties as options\n String optionName = param.toLowerCase().replace(RequestMap.USER_PROP_PREFIX_LOWERCASE, \"\");\n String optionValue = params.removeUserProperty(optionName);\n context.addOption(optionName, optionValue);\n LOG.debug(\"Added option {} to request context\", optionName);\n\n // lookup if the option should also be applied as a config property\n String propertyName = optionMappings.get(optionName);\n if (StringUtils.isNotBlank(propertyName)) {\n // if option has been provided by the user in the request, set the value\n // of the corresponding configuration property\n if (optionValue != null) {\n additionalConfigProps.put(propertyName, optionValue);\n // do not log property value as it might contain sensitive information\n LOG.debug(\"Added extra config property {} from option {}\", propertyName, optionName);\n }\n }\n } else if (StringUtils.startsWithIgnoreCase(param, RequestMap.PROP_PREFIX)) {\n // log debug for all left-over system properties\n LOG.debug(\"Unused property {}\", param);\n }\n }\n\n context.setAdditionalConfigProps(additionalConfigProps);\n context.setPluginConf(pluginConf);\n\n // Call the protocol handler for any protocol-specific logic handling\n if (StringUtils.isNotBlank(profile)) {\n String handlerClassName = pluginConf.getHandler(profile);\n if (StringUtils.isNotBlank(handlerClassName)) {\n Class<?> clazz;\n try {\n clazz = Class.forName(handlerClassName);\n ProtocolHandler handler = (ProtocolHandler) clazz.getDeclaredConstructor().newInstance();\n context.setFragmenter(handler.getFragmenterClassName(context));\n context.setAccessor(handler.getAccessorClassName(context));\n context.setResolver(handler.getResolverClassName(context));\n } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |\n InstantiationException | IllegalAccessException e) {\n throw new RuntimeException(String.format(\"Error when invoking handlerClass '%s' : %s\", handlerClassName, e), e);\n }\n }\n }\n\n // validate that the result has all required fields, and values are in valid ranges\n context.validate();\n\n return context;\n }", "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "invocations": [ "getRequestHeaders", "isDebugEnabled", "debug", "keySet", "setRequestType", "removeUserProperty", "setProfile", "addProfilePlugins", "removeProperty", "setOutputFormat", "valueOf", "removeUserProperty", "isNotBlank", "inferFormatName", "setFormat", "setAccessor", "removeUserProperty", "setAggType", "getAggregationType", "removeOptionalProperty", "removeOptionalProperty", "isNotBlank", "setDataFragment", "parseInt", "setDataSource", "removeProperty", "removeOptionalProperty", "removeProperty", "setFilterString", "equals", "info", "setFragmenter", "removeUserProperty", "removeOptionalProperty", "isNotBlank", "setFragmentIndex", "parseInt", "removeOptionalProperty", "setFragmentMetadata", "parseBase64", "setHost", "removeProperty", "setMetadata", "removeUserProperty", "setPort", "removeIntProperty", "setProfileScheme", "removeUserProperty", "setProtocol", "removeUserProperty", "setRemoteLogin", "removeOptionalProperty", "setRemoteSecret", "removeOptionalProperty", "setResolver", "removeUserProperty", "setSegmentId", "removeIntProperty", "setServerName", "removeUserProperty", "removeUserProperty", "setConfig", "isNotBlank", "getServerName", "removeUserProperty", "isBlank", "setStatsMaxFragments", "parseInt", "removeUserProperty", "isBlank", "setStatsSampleRatio", "parseFloat", "setTotalSegments", "removeIntProperty", "setTransactionId", "removeProperty", "parseTupleDescription", "getOutputFormat", "parseGreenplumCSV", "size", "getTupleDescription", "getDelimiter", "getGreenplumCSV", "format", "size", "getTupleDescription", "setUser", "removeProperty", "removeOptionalProperty", "setUserData", "parseBase64", "setProperty", "removeProperty", "isNotBlank", "getOptionMappings", "emptyMap", "keySet", "startsWithIgnoreCase", "replace", "toLowerCase", "removeUserProperty", "addOption", "debug", "get", "isNotBlank", "put", "debug", "startsWithIgnoreCase", "debug", "setAdditionalConfigProps", "setPluginConf", "isNotBlank", "getHandler", "isNotBlank", "forName", "newInstance", "getDeclaredConstructor", "setFragmenter", "getFragmenterClassName", "setAccessor", "getAccessorClassName", "setResolver", "getResolverClassName", "format", "validate" ], "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_347
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "manager = ConnectionManager.getInstance()", "modifier": "private", "original_string": "private ConnectionManager manager = ConnectionManager.getInstance();", "type": "ConnectionManager", "var_name": "manager" }, { "declarator": "connProps", "modifier": "private", "original_string": "private Properties connProps, poolProps;", "type": "Properties", "var_name": "connProps" }, { "declarator": "mockConnection", "modifier": "private", "original_string": "private Connection mockConnection;", "type": "Connection", "var_name": "mockConnection" } ], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/utils/ConnectionManagerTest.java", "identifier": "ConnectionManagerTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetConnectionPoolEnabledNoPoolProps() throws SQLException {\n Driver mockDriver = mock(Driver.class);\n when(DriverManager.getDriver(\"test-url\")).thenReturn(mockDriver);\n when(mockDriver.connect(\"test-url\", connProps)).thenReturn(mockConnection);\n\n Driver mockDriver2 = mock(Driver.class); ;\n when(DriverManager.getDriver(\"test-url-2\")).thenReturn(mockDriver2);\n Connection mockConnection2 = mock(Connection.class);\n when(mockDriver2.connect(\"test-url-2\", connProps)).thenReturn(mockConnection2);\n\n Connection conn;\n for (int i=0; i< 5; i++) {\n conn = manager.getConnection(\"test-server\", \"test-url\", connProps, true, poolProps, null);\n assertNotNull(conn);\n assertTrue(conn instanceof HikariProxyConnection);\n assertSame(mockConnection, conn.unwrap(Connection.class));\n conn.close();\n }\n\n Connection conn2 = manager.getConnection(\"test-server\", \"test-url-2\", connProps, true, poolProps, null);\n assertNotNull(conn2);\n assertTrue(conn2 instanceof HikariProxyConnection);\n assertSame(mockConnection2, conn2.unwrap(Connection.class));\n\n verify(mockDriver, times(1)).connect(\"test-url\", connProps);\n verify(mockDriver2, times(1)).connect(\"test-url-2\", connProps);\n }", "class_method_signature": "ConnectionManagerTest.testGetConnectionPoolEnabledNoPoolProps()", "constructor": false, "full_signature": "@Test public void testGetConnectionPoolEnabledNoPoolProps()", "identifier": "testGetConnectionPoolEnabledNoPoolProps", "invocations": [ "mock", "thenReturn", "when", "getDriver", "thenReturn", "when", "connect", "mock", "thenReturn", "when", "getDriver", "mock", "thenReturn", "when", "connect", "getConnection", "assertNotNull", "assertTrue", "assertSame", "unwrap", "close", "getConnection", "assertNotNull", "assertTrue", "assertSame", "unwrap", "connect", "verify", "times", "connect", "verify", "times" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGetConnectionPoolEnabledNoPoolProps()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(ConnectionManager.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(ConnectionManager.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "CLEANUP_SLEEP_INTERVAL_NANOS = TimeUnit.MINUTES.toNanos(5)", "modifier": "static final", "original_string": "static final long CLEANUP_SLEEP_INTERVAL_NANOS = TimeUnit.MINUTES.toNanos(5);", "type": "long", "var_name": "CLEANUP_SLEEP_INTERVAL_NANOS" }, { "declarator": "CLEANUP_TIMEOUT_NANOS = TimeUnit.HOURS.toNanos(24)", "modifier": "static final", "original_string": "static final long CLEANUP_TIMEOUT_NANOS = TimeUnit.HOURS.toNanos(24);", "type": "long", "var_name": "CLEANUP_TIMEOUT_NANOS" }, { "declarator": "POOL_EXPIRATION_TIMEOUT_HOURS = 6", "modifier": "static final", "original_string": "static final long POOL_EXPIRATION_TIMEOUT_HOURS = 6;", "type": "long", "var_name": "POOL_EXPIRATION_TIMEOUT_HOURS" }, { "declarator": "instance = new ConnectionManager()", "modifier": "private static final", "original_string": "private static final ConnectionManager instance = new ConnectionManager();", "type": "ConnectionManager", "var_name": "instance" }, { "declarator": "datasourceClosingExecutor", "modifier": "private", "original_string": "private Executor datasourceClosingExecutor;", "type": "Executor", "var_name": "datasourceClosingExecutor" }, { "declarator": "dataSources", "modifier": "private", "original_string": "private LoadingCache<PoolDescriptor, HikariDataSource> dataSources;", "type": "LoadingCache<PoolDescriptor, HikariDataSource>", "var_name": "dataSources" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/utils/ConnectionManager.java", "identifier": "ConnectionManager", "interfaces": "", "methods": [ { "class_method_signature": "ConnectionManager.ConnectionManager()", "constructor": true, "full_signature": "private ConnectionManager()", "identifier": "ConnectionManager", "modifiers": "private", "parameters": "()", "return": "", "signature": " ConnectionManager()", "testcase": false }, { "class_method_signature": "ConnectionManager.ConnectionManager(DataSourceFactory factory, Ticker ticker, long sleepIntervalNanos)", "constructor": true, "full_signature": " ConnectionManager(DataSourceFactory factory, Ticker ticker, long sleepIntervalNanos)", "identifier": "ConnectionManager", "modifiers": "", "parameters": "(DataSourceFactory factory, Ticker ticker, long sleepIntervalNanos)", "return": "", "signature": " ConnectionManager(DataSourceFactory factory, Ticker ticker, long sleepIntervalNanos)", "testcase": false }, { "class_method_signature": "ConnectionManager.cleanCache()", "constructor": false, "full_signature": " void cleanCache()", "identifier": "cleanCache", "modifiers": "", "parameters": "()", "return": "void", "signature": "void cleanCache()", "testcase": false }, { "class_method_signature": "ConnectionManager.getInstance()", "constructor": false, "full_signature": "public static ConnectionManager getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "ConnectionManager", "signature": "ConnectionManager getInstance()", "testcase": false }, { "class_method_signature": "ConnectionManager.getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "constructor": false, "full_signature": "public Connection getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "identifier": "getConnection", "modifiers": "public", "parameters": "(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "return": "Connection", "signature": "Connection getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "testcase": false }, { "class_method_signature": "ConnectionManager.maskPassword(String password)", "constructor": false, "full_signature": "public static String maskPassword(String password)", "identifier": "maskPassword", "modifiers": "public static", "parameters": "(String password)", "return": "String", "signature": "String maskPassword(String password)", "testcase": false } ], "superclass": "" }
{ "body": "public Connection getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier) throws SQLException {\n\n Connection result;\n if (!isPoolEnabled) {\n LOG.debug(\"Requesting DriverManager.getConnection for server={}\", server);\n result = DriverManager.getConnection(jdbcUrl, connectionConfiguration);\n } else {\n\n PoolDescriptor poolDescriptor = new PoolDescriptor(server, jdbcUrl, connectionConfiguration, poolConfiguration, qualifier);\n\n DataSource dataSource;\n try {\n LOG.debug(\"Requesting datasource for server={} and {}\", server, poolDescriptor);\n dataSource = dataSources.getUnchecked(poolDescriptor);\n LOG.debug(\"Obtained datasource {} for server={} and {}\", dataSource.hashCode(), server, poolDescriptor);\n } catch (UncheckedExecutionException e) {\n Throwable cause = e.getCause() != null ? e.getCause() : e;\n throw new SQLException(String.format(\"Could not obtain datasource for server %s and %s : %s\", server, poolDescriptor, cause.getMessage()), cause);\n }\n result = dataSource.getConnection();\n }\n LOG.debug(\"Returning JDBC connection {} for server={}\", result, server);\n\n return result;\n }", "class_method_signature": "ConnectionManager.getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "constructor": false, "full_signature": "public Connection getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "identifier": "getConnection", "invocations": [ "debug", "getConnection", "debug", "getUnchecked", "debug", "hashCode", "getCause", "getCause", "format", "getMessage", "getConnection", "debug" ], "modifiers": "public", "parameters": "(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "return": "Connection", "signature": "Connection getConnection(String server, String jdbcUrl, Properties connectionConfiguration, boolean isPoolEnabled, Properties poolConfiguration, String qualifier)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_193
{ "fields": [ { "declarator": "response = null", "modifier": "", "original_string": "MetadataResponse response = null;", "type": "MetadataResponse", "var_name": "response" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/MetadataResponseFormatterTest.java", "identifier": "MetadataResponseFormatterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void formatResponseStringPartialNull() throws Exception {\n List<Metadata> metadataList = new ArrayList<Metadata>();\n List<Metadata.Field> fields = new ArrayList<Metadata.Field>();\n Metadata.Item itemName = new Metadata.Item(\"default\", \"table1\");\n Metadata metadata = new Metadata(itemName, fields);\n fields.add(new Metadata.Field(\"field1\", EnumGpdbType.Int8Type, \"bigint\"));\n metadataList.add(null);\n metadataList.add(metadata);\n try {\n response = MetadataResponseFormatter.formatResponse(metadataList, \"path.file\");\n convertResponseToString(response);\n fail(\"formatting should fail because one of the metdata object is null\");\n } catch (IllegalArgumentException e) {\n assertEquals(\"metadata object is null - cannot serialize\", e.getMessage());\n }\n }", "class_method_signature": "MetadataResponseFormatterTest.formatResponseStringPartialNull()", "constructor": false, "full_signature": "@Test public void formatResponseStringPartialNull()", "identifier": "formatResponseStringPartialNull", "invocations": [ "add", "add", "add", "formatResponse", "convertResponseToString", "fail", "assertEquals", "getMessage" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void formatResponseStringPartialNull()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LogFactory.getLog(MetadataResponseFormatter.class)", "modifier": "private static final", "original_string": "private static final Log LOG = LogFactory.getLog(MetadataResponseFormatter.class);", "type": "Log", "var_name": "LOG" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/MetadataResponseFormatter.java", "identifier": "MetadataResponseFormatter", "interfaces": "", "methods": [ { "class_method_signature": "MetadataResponseFormatter.formatResponse(List<Metadata> metadataList, String path)", "constructor": false, "full_signature": "public static MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "identifier": "formatResponse", "modifiers": "public static", "parameters": "(List<Metadata> metadataList, String path)", "return": "MetadataResponse", "signature": "MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "testcase": false }, { "class_method_signature": "MetadataResponseFormatter.printMetadata(List<Metadata> metadataList, String path)", "constructor": false, "full_signature": "private static void printMetadata(List<Metadata> metadataList, String path)", "identifier": "printMetadata", "modifiers": "private static", "parameters": "(List<Metadata> metadataList, String path)", "return": "void", "signature": "void printMetadata(List<Metadata> metadataList, String path)", "testcase": false } ], "superclass": "" }
{ "body": "public static MetadataResponse formatResponse(List<Metadata> metadataList, String path) throws IOException {\n /* print the fragment list to log when in debug level */\n if (LOG.isDebugEnabled()) {\n MetadataResponseFormatter.printMetadata(metadataList, path);\n }\n\n return new MetadataResponse(metadataList);\n }", "class_method_signature": "MetadataResponseFormatter.formatResponse(List<Metadata> metadataList, String path)", "constructor": false, "full_signature": "public static MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "identifier": "formatResponse", "invocations": [ "isDebugEnabled", "printMetadata" ], "modifiers": "public static", "parameters": "(List<Metadata> metadataList, String path)", "return": "MetadataResponse", "signature": "MetadataResponse formatResponse(List<Metadata> metadataList, String path)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_20
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/RequestContextTest.java", "identifier": "RequestContextTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testStatsMaxFragmentsFailsOnNegative() {\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"Wrong value '-1'. STATS-MAX-FRAGMENTS must be a positive integer\");\n context.setStatsMaxFragments(-1);\n }", "class_method_signature": "RequestContextTest.testStatsMaxFragmentsFailsOnNegative()", "constructor": false, "full_signature": "@Test public void testStatsMaxFragmentsFailsOnNegative()", "identifier": "testStatsMaxFragmentsFailsOnNegative", "invocations": [ "expect", "expectMessage", "setStatsMaxFragments" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testStatsMaxFragmentsFailsOnNegative()", "testcase": true }
{ "fields": [ { "declarator": "requestType", "modifier": "private", "original_string": "private RequestType requestType;", "type": "RequestType", "var_name": "requestType" }, { "declarator": "accessor", "modifier": "private", "original_string": "private String accessor;", "type": "String", "var_name": "accessor" }, { "declarator": "aggType", "modifier": "private", "original_string": "private EnumAggregationType aggType;", "type": "EnumAggregationType", "var_name": "aggType" }, { "declarator": "config", "modifier": "private", "original_string": "private String config;", "type": "String", "var_name": "config" }, { "declarator": "dataFragment = -1", "modifier": "private", "original_string": "private int dataFragment = -1;", "type": "int", "var_name": "dataFragment" }, { "declarator": "dataSource", "modifier": "private", "original_string": "private String dataSource;", "type": "String", "var_name": "dataSource" }, { "declarator": "fragmenter", "modifier": "private", "original_string": "private String fragmenter;", "type": "String", "var_name": "fragmenter" }, { "declarator": "fragmentIndex", "modifier": "private", "original_string": "private int fragmentIndex;", "type": "int", "var_name": "fragmentIndex" }, { "declarator": "fragmentMetadata = null", "modifier": "private", "original_string": "private byte[] fragmentMetadata = null;", "type": "byte[]", "var_name": "fragmentMetadata" }, { "declarator": "filterString", "modifier": "private", "original_string": "private String filterString;", "type": "String", "var_name": "filterString" }, { "declarator": "metadata", "modifier": "private", "original_string": "private Object metadata;", "type": "Object", "var_name": "metadata" }, { "declarator": "outputFormat", "modifier": "private", "original_string": "private OutputFormat outputFormat;", "type": "OutputFormat", "var_name": "outputFormat" }, { "declarator": "port", "modifier": "private", "original_string": "private int port;", "type": "int", "var_name": "port" }, { "declarator": "host", "modifier": "private", "original_string": "private String host;", "type": "String", "var_name": "host" }, { "declarator": "token", "modifier": "private", "original_string": "private String token;", "type": "String", "var_name": "token" }, { "declarator": "statsMaxFragments = 0", "modifier": "private", "original_string": "private int statsMaxFragments = 0;", "type": "int", "var_name": "statsMaxFragments" }, { "declarator": "statsSampleRatio = 0", "modifier": "private", "original_string": "private float statsSampleRatio = 0;", "type": "float", "var_name": "statsSampleRatio" }, { "declarator": "numAttrsProjected", "modifier": "private", "original_string": "private int numAttrsProjected;", "type": "int", "var_name": "numAttrsProjected" }, { "declarator": "profile", "modifier": "private", "original_string": "private String profile;", "type": "String", "var_name": "profile" }, { "declarator": "profileScheme", "modifier": "private", "original_string": "private String profileScheme;", "type": "String", "var_name": "profileScheme" }, { "declarator": "protocol", "modifier": "private", "original_string": "private String protocol;", "type": "String", "var_name": "protocol" }, { "declarator": "format", "modifier": "private", "original_string": "private String format;", "type": "String", "var_name": "format" }, { "declarator": "greenplumCSV = new GreenplumCSV()", "modifier": "private", "original_string": "private GreenplumCSV greenplumCSV = new GreenplumCSV();", "type": "GreenplumCSV", "var_name": "greenplumCSV" }, { "declarator": "recordkeyColumn", "modifier": "private", "original_string": "private ColumnDescriptor recordkeyColumn;", "type": "ColumnDescriptor", "var_name": "recordkeyColumn" }, { "declarator": "remoteLogin", "modifier": "private", "original_string": "private String remoteLogin;", "type": "String", "var_name": "remoteLogin" }, { "declarator": "remoteSecret", "modifier": "private", "original_string": "private String remoteSecret;", "type": "String", "var_name": "remoteSecret" }, { "declarator": "resolver", "modifier": "private", "original_string": "private String resolver;", "type": "String", "var_name": "resolver" }, { "declarator": "segmentId", "modifier": "private", "original_string": "private int segmentId;", "type": "int", "var_name": "segmentId" }, { "declarator": "transactionId", "modifier": "private", "original_string": "private String transactionId;", "type": "String", "var_name": "transactionId" }, { "declarator": "serverName = \"default\"", "modifier": "private", "original_string": "private String serverName = \"default\";", "type": "String", "var_name": "serverName" }, { "declarator": "totalSegments", "modifier": "private", "original_string": "private int totalSegments;", "type": "int", "var_name": "totalSegments" }, { "declarator": "tupleDescription = new ArrayList<>()", "modifier": "private", "original_string": "private List<ColumnDescriptor> tupleDescription = new ArrayList<>();", "type": "List<ColumnDescriptor>", "var_name": "tupleDescription" }, { "declarator": "user", "modifier": "private", "original_string": "private String user;", "type": "String", "var_name": "user" }, { "declarator": "userData", "modifier": "private", "original_string": "private byte[] userData;", "type": "byte[]", "var_name": "userData" }, { "declarator": "additionalConfigProps", "modifier": "private", "original_string": "private Map<String, String> additionalConfigProps;", "type": "Map<String, String>", "var_name": "additionalConfigProps" }, { "declarator": "options = new TreeMap<>(String.CASE_INSENSITIVE_ORDER)", "modifier": "private final", "original_string": "private final Map<String, String> options = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);", "type": "Map<String, String>", "var_name": "options" }, { "declarator": "pluginConf", "modifier": "private", "original_string": "private PluginConf pluginConf;", "type": "PluginConf", "var_name": "pluginConf" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/RequestContext.java", "identifier": "RequestContext", "interfaces": "", "methods": [ { "class_method_signature": "RequestContext.getRequestType()", "constructor": false, "full_signature": "public RequestType getRequestType()", "identifier": "getRequestType", "modifiers": "public", "parameters": "()", "return": "RequestType", "signature": "RequestType getRequestType()", "testcase": false }, { "class_method_signature": "RequestContext.setRequestType(RequestType requestType)", "constructor": false, "full_signature": "public void setRequestType(RequestType requestType)", "identifier": "setRequestType", "modifiers": "public", "parameters": "(RequestType requestType)", "return": "void", "signature": "void setRequestType(RequestType requestType)", "testcase": false }, { "class_method_signature": "RequestContext.getOption(String option, String defaultValue)", "constructor": false, "full_signature": "public String getOption(String option, String defaultValue)", "identifier": "getOption", "modifiers": "public", "parameters": "(String option, String defaultValue)", "return": "String", "signature": "String getOption(String option, String defaultValue)", "testcase": false }, { "class_method_signature": "RequestContext.getOption(String option, int defaultValue)", "constructor": false, "full_signature": "public int getOption(String option, int defaultValue)", "identifier": "getOption", "modifiers": "public", "parameters": "(String option, int defaultValue)", "return": "int", "signature": "int getOption(String option, int defaultValue)", "testcase": false }, { "class_method_signature": "RequestContext.getOption(String option, int defaultValue, boolean naturalOnly)", "constructor": false, "full_signature": "public int getOption(String option, int defaultValue, boolean naturalOnly)", "identifier": "getOption", "modifiers": "public", "parameters": "(String option, int defaultValue, boolean naturalOnly)", "return": "int", "signature": "int getOption(String option, int defaultValue, boolean naturalOnly)", "testcase": false }, { "class_method_signature": "RequestContext.getOption(String option)", "constructor": false, "full_signature": "public String getOption(String option)", "identifier": "getOption", "modifiers": "public", "parameters": "(String option)", "return": "String", "signature": "String getOption(String option)", "testcase": false }, { "class_method_signature": "RequestContext.getOption(String option, boolean defaultValue)", "constructor": false, "full_signature": "public boolean getOption(String option, boolean defaultValue)", "identifier": "getOption", "modifiers": "public", "parameters": "(String option, boolean defaultValue)", "return": "boolean", "signature": "boolean getOption(String option, boolean defaultValue)", "testcase": false }, { "class_method_signature": "RequestContext.addOption(String name, String value)", "constructor": false, "full_signature": "public void addOption(String name, String value)", "identifier": "addOption", "modifiers": "public", "parameters": "(String name, String value)", "return": "void", "signature": "void addOption(String name, String value)", "testcase": false }, { "class_method_signature": "RequestContext.getOptions()", "constructor": false, "full_signature": "public Map<String, String> getOptions()", "identifier": "getOptions", "modifiers": "public", "parameters": "()", "return": "Map<String, String>", "signature": "Map<String, String> getOptions()", "testcase": false }, { "class_method_signature": "RequestContext.getRemoteLogin()", "constructor": false, "full_signature": "public String getRemoteLogin()", "identifier": "getRemoteLogin", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getRemoteLogin()", "testcase": false }, { "class_method_signature": "RequestContext.setRemoteLogin(String remoteLogin)", "constructor": false, "full_signature": "public void setRemoteLogin(String remoteLogin)", "identifier": "setRemoteLogin", "modifiers": "public", "parameters": "(String remoteLogin)", "return": "void", "signature": "void setRemoteLogin(String remoteLogin)", "testcase": false }, { "class_method_signature": "RequestContext.getRemoteSecret()", "constructor": false, "full_signature": "public String getRemoteSecret()", "identifier": "getRemoteSecret", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getRemoteSecret()", "testcase": false }, { "class_method_signature": "RequestContext.setRemoteSecret(String remoteSecret)", "constructor": false, "full_signature": "public void setRemoteSecret(String remoteSecret)", "identifier": "setRemoteSecret", "modifiers": "public", "parameters": "(String remoteSecret)", "return": "void", "signature": "void setRemoteSecret(String remoteSecret)", "testcase": false }, { "class_method_signature": "RequestContext.getUserData()", "constructor": false, "full_signature": "public byte[] getUserData()", "identifier": "getUserData", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getUserData()", "testcase": false }, { "class_method_signature": "RequestContext.setUserData(byte[] userData)", "constructor": false, "full_signature": "public void setUserData(byte[] userData)", "identifier": "setUserData", "modifiers": "public", "parameters": "(byte[] userData)", "return": "void", "signature": "void setUserData(byte[] userData)", "testcase": false }, { "class_method_signature": "RequestContext.getFragmentMetadata()", "constructor": false, "full_signature": "public byte[] getFragmentMetadata()", "identifier": "getFragmentMetadata", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getFragmentMetadata()", "testcase": false }, { "class_method_signature": "RequestContext.setFragmentMetadata(byte[] fragmentMetadata)", "constructor": false, "full_signature": "public void setFragmentMetadata(byte[] fragmentMetadata)", "identifier": "setFragmentMetadata", "modifiers": "public", "parameters": "(byte[] fragmentMetadata)", "return": "void", "signature": "void setFragmentMetadata(byte[] fragmentMetadata)", "testcase": false }, { "class_method_signature": "RequestContext.getFragmentUserData()", "constructor": false, "full_signature": "public byte[] getFragmentUserData()", "identifier": "getFragmentUserData", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getFragmentUserData()", "testcase": false }, { "class_method_signature": "RequestContext.setFragmentUserData(byte[] userData)", "constructor": false, "full_signature": "public void setFragmentUserData(byte[] userData)", "identifier": "setFragmentUserData", "modifiers": "public", "parameters": "(byte[] userData)", "return": "void", "signature": "void setFragmentUserData(byte[] userData)", "testcase": false }, { "class_method_signature": "RequestContext.getTotalSegments()", "constructor": false, "full_signature": "public int getTotalSegments()", "identifier": "getTotalSegments", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getTotalSegments()", "testcase": false }, { "class_method_signature": "RequestContext.setTotalSegments(int totalSegments)", "constructor": false, "full_signature": "public void setTotalSegments(int totalSegments)", "identifier": "setTotalSegments", "modifiers": "public", "parameters": "(int totalSegments)", "return": "void", "signature": "void setTotalSegments(int totalSegments)", "testcase": false }, { "class_method_signature": "RequestContext.getSegmentId()", "constructor": false, "full_signature": "public int getSegmentId()", "identifier": "getSegmentId", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getSegmentId()", "testcase": false }, { "class_method_signature": "RequestContext.setSegmentId(int segmentId)", "constructor": false, "full_signature": "public void setSegmentId(int segmentId)", "identifier": "setSegmentId", "modifiers": "public", "parameters": "(int segmentId)", "return": "void", "signature": "void setSegmentId(int segmentId)", "testcase": false }, { "class_method_signature": "RequestContext.hasFilter()", "constructor": false, "full_signature": "public boolean hasFilter()", "identifier": "hasFilter", "modifiers": "public", "parameters": "()", "return": "boolean", "signature": "boolean hasFilter()", "testcase": false }, { "class_method_signature": "RequestContext.hasColumnProjection()", "constructor": false, "full_signature": "public boolean hasColumnProjection()", "identifier": "hasColumnProjection", "modifiers": "public", "parameters": "()", "return": "boolean", "signature": "boolean hasColumnProjection()", "testcase": false }, { "class_method_signature": "RequestContext.getFilterString()", "constructor": false, "full_signature": "public String getFilterString()", "identifier": "getFilterString", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getFilterString()", "testcase": false }, { "class_method_signature": "RequestContext.setFilterString(String filterString)", "constructor": false, "full_signature": "public void setFilterString(String filterString)", "identifier": "setFilterString", "modifiers": "public", "parameters": "(String filterString)", "return": "void", "signature": "void setFilterString(String filterString)", "testcase": false }, { "class_method_signature": "RequestContext.getTupleDescription()", "constructor": false, "full_signature": "public List<ColumnDescriptor> getTupleDescription()", "identifier": "getTupleDescription", "modifiers": "public", "parameters": "()", "return": "List<ColumnDescriptor>", "signature": "List<ColumnDescriptor> getTupleDescription()", "testcase": false }, { "class_method_signature": "RequestContext.setTupleDescription(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "public void setTupleDescription(List<ColumnDescriptor> tupleDescription)", "identifier": "setTupleDescription", "modifiers": "public", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "void", "signature": "void setTupleDescription(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "RequestContext.getColumns()", "constructor": false, "full_signature": "public int getColumns()", "identifier": "getColumns", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getColumns()", "testcase": false }, { "class_method_signature": "RequestContext.getColumn(int index)", "constructor": false, "full_signature": "public ColumnDescriptor getColumn(int index)", "identifier": "getColumn", "modifiers": "public", "parameters": "(int index)", "return": "ColumnDescriptor", "signature": "ColumnDescriptor getColumn(int index)", "testcase": false }, { "class_method_signature": "RequestContext.getConfig()", "constructor": false, "full_signature": "public String getConfig()", "identifier": "getConfig", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getConfig()", "testcase": false }, { "class_method_signature": "RequestContext.setConfig(String config)", "constructor": false, "full_signature": "public void setConfig(String config)", "identifier": "setConfig", "modifiers": "public", "parameters": "(String config)", "return": "void", "signature": "void setConfig(String config)", "testcase": false }, { "class_method_signature": "RequestContext.getRecordkeyColumn()", "constructor": false, "full_signature": "public ColumnDescriptor getRecordkeyColumn()", "identifier": "getRecordkeyColumn", "modifiers": "public", "parameters": "()", "return": "ColumnDescriptor", "signature": "ColumnDescriptor getRecordkeyColumn()", "testcase": false }, { "class_method_signature": "RequestContext.setRecordkeyColumn(ColumnDescriptor recordkeyColumn)", "constructor": false, "full_signature": "public void setRecordkeyColumn(ColumnDescriptor recordkeyColumn)", "identifier": "setRecordkeyColumn", "modifiers": "public", "parameters": "(ColumnDescriptor recordkeyColumn)", "return": "void", "signature": "void setRecordkeyColumn(ColumnDescriptor recordkeyColumn)", "testcase": false }, { "class_method_signature": "RequestContext.getDataSource()", "constructor": false, "full_signature": "public String getDataSource()", "identifier": "getDataSource", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getDataSource()", "testcase": false }, { "class_method_signature": "RequestContext.setDataSource(String dataSource)", "constructor": false, "full_signature": "public void setDataSource(String dataSource)", "identifier": "setDataSource", "modifiers": "public", "parameters": "(String dataSource)", "return": "void", "signature": "void setDataSource(String dataSource)", "testcase": false }, { "class_method_signature": "RequestContext.getProfile()", "constructor": false, "full_signature": "public String getProfile()", "identifier": "getProfile", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getProfile()", "testcase": false }, { "class_method_signature": "RequestContext.setProfile(String profile)", "constructor": false, "full_signature": "public void setProfile(String profile)", "identifier": "setProfile", "modifiers": "public", "parameters": "(String profile)", "return": "void", "signature": "void setProfile(String profile)", "testcase": false }, { "class_method_signature": "RequestContext.getAccessor()", "constructor": false, "full_signature": "public String getAccessor()", "identifier": "getAccessor", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getAccessor()", "testcase": false }, { "class_method_signature": "RequestContext.setAccessor(String accessor)", "constructor": false, "full_signature": "public void setAccessor(String accessor)", "identifier": "setAccessor", "modifiers": "public", "parameters": "(String accessor)", "return": "void", "signature": "void setAccessor(String accessor)", "testcase": false }, { "class_method_signature": "RequestContext.getResolver()", "constructor": false, "full_signature": "public String getResolver()", "identifier": "getResolver", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getResolver()", "testcase": false }, { "class_method_signature": "RequestContext.setResolver(String resolver)", "constructor": false, "full_signature": "public void setResolver(String resolver)", "identifier": "setResolver", "modifiers": "public", "parameters": "(String resolver)", "return": "void", "signature": "void setResolver(String resolver)", "testcase": false }, { "class_method_signature": "RequestContext.getFragmenter()", "constructor": false, "full_signature": "public String getFragmenter()", "identifier": "getFragmenter", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getFragmenter()", "testcase": false }, { "class_method_signature": "RequestContext.setFragmenter(String fragmenter)", "constructor": false, "full_signature": "public void setFragmenter(String fragmenter)", "identifier": "setFragmenter", "modifiers": "public", "parameters": "(String fragmenter)", "return": "void", "signature": "void setFragmenter(String fragmenter)", "testcase": false }, { "class_method_signature": "RequestContext.getMetadata()", "constructor": false, "full_signature": "public Object getMetadata()", "identifier": "getMetadata", "modifiers": "public", "parameters": "()", "return": "Object", "signature": "Object getMetadata()", "testcase": false }, { "class_method_signature": "RequestContext.setMetadata(Object metadata)", "constructor": false, "full_signature": "public void setMetadata(Object metadata)", "identifier": "setMetadata", "modifiers": "public", "parameters": "(Object metadata)", "return": "void", "signature": "void setMetadata(Object metadata)", "testcase": false }, { "class_method_signature": "RequestContext.getLogin()", "constructor": false, "full_signature": "public String getLogin()", "identifier": "getLogin", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getLogin()", "testcase": false }, { "class_method_signature": "RequestContext.getSecret()", "constructor": false, "full_signature": "public String getSecret()", "identifier": "getSecret", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getSecret()", "testcase": false }, { "class_method_signature": "RequestContext.getDataFragment()", "constructor": false, "full_signature": "public int getDataFragment()", "identifier": "getDataFragment", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getDataFragment()", "testcase": false }, { "class_method_signature": "RequestContext.setDataFragment(int dataFragment)", "constructor": false, "full_signature": "public void setDataFragment(int dataFragment)", "identifier": "setDataFragment", "modifiers": "public", "parameters": "(int dataFragment)", "return": "void", "signature": "void setDataFragment(int dataFragment)", "testcase": false }, { "class_method_signature": "RequestContext.getAggType()", "constructor": false, "full_signature": "public EnumAggregationType getAggType()", "identifier": "getAggType", "modifiers": "public", "parameters": "()", "return": "EnumAggregationType", "signature": "EnumAggregationType getAggType()", "testcase": false }, { "class_method_signature": "RequestContext.setAggType(EnumAggregationType aggType)", "constructor": false, "full_signature": "public void setAggType(EnumAggregationType aggType)", "identifier": "setAggType", "modifiers": "public", "parameters": "(EnumAggregationType aggType)", "return": "void", "signature": "void setAggType(EnumAggregationType aggType)", "testcase": false }, { "class_method_signature": "RequestContext.getFormat()", "constructor": false, "full_signature": "public String getFormat()", "identifier": "getFormat", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getFormat()", "testcase": false }, { "class_method_signature": "RequestContext.setFormat(String format)", "constructor": false, "full_signature": "public void setFormat(String format)", "identifier": "setFormat", "modifiers": "public", "parameters": "(String format)", "return": "void", "signature": "void setFormat(String format)", "testcase": false }, { "class_method_signature": "RequestContext.getFragmentIndex()", "constructor": false, "full_signature": "public int getFragmentIndex()", "identifier": "getFragmentIndex", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getFragmentIndex()", "testcase": false }, { "class_method_signature": "RequestContext.setFragmentIndex(int fragmentIndex)", "constructor": false, "full_signature": "public void setFragmentIndex(int fragmentIndex)", "identifier": "setFragmentIndex", "modifiers": "public", "parameters": "(int fragmentIndex)", "return": "void", "signature": "void setFragmentIndex(int fragmentIndex)", "testcase": false }, { "class_method_signature": "RequestContext.getNumAttrsProjected()", "constructor": false, "full_signature": "public int getNumAttrsProjected()", "identifier": "getNumAttrsProjected", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getNumAttrsProjected()", "testcase": false }, { "class_method_signature": "RequestContext.setNumAttrsProjected(int numAttrsProjected)", "constructor": false, "full_signature": "public void setNumAttrsProjected(int numAttrsProjected)", "identifier": "setNumAttrsProjected", "modifiers": "public", "parameters": "(int numAttrsProjected)", "return": "void", "signature": "void setNumAttrsProjected(int numAttrsProjected)", "testcase": false }, { "class_method_signature": "RequestContext.getServerName()", "constructor": false, "full_signature": "public String getServerName()", "identifier": "getServerName", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getServerName()", "testcase": false }, { "class_method_signature": "RequestContext.setServerName(String serverName)", "constructor": false, "full_signature": "public void setServerName(String serverName)", "identifier": "setServerName", "modifiers": "public", "parameters": "(String serverName)", "return": "void", "signature": "void setServerName(String serverName)", "testcase": false }, { "class_method_signature": "RequestContext.getUser()", "constructor": false, "full_signature": "public String getUser()", "identifier": "getUser", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getUser()", "testcase": false }, { "class_method_signature": "RequestContext.setUser(String user)", "constructor": false, "full_signature": "public void setUser(String user)", "identifier": "setUser", "modifiers": "public", "parameters": "(String user)", "return": "void", "signature": "void setUser(String user)", "testcase": false }, { "class_method_signature": "RequestContext.getPort()", "constructor": false, "full_signature": "public int getPort()", "identifier": "getPort", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getPort()", "testcase": false }, { "class_method_signature": "RequestContext.setPort(int port)", "constructor": false, "full_signature": "public void setPort(int port)", "identifier": "setPort", "modifiers": "public", "parameters": "(int port)", "return": "void", "signature": "void setPort(int port)", "testcase": false }, { "class_method_signature": "RequestContext.getGreenplumCSV()", "constructor": false, "full_signature": "public GreenplumCSV getGreenplumCSV()", "identifier": "getGreenplumCSV", "modifiers": "public", "parameters": "()", "return": "GreenplumCSV", "signature": "GreenplumCSV getGreenplumCSV()", "testcase": false }, { "class_method_signature": "RequestContext.setGreenplumCSV(GreenplumCSV greenplumCSV)", "constructor": false, "full_signature": "public void setGreenplumCSV(GreenplumCSV greenplumCSV)", "identifier": "setGreenplumCSV", "modifiers": "public", "parameters": "(GreenplumCSV greenplumCSV)", "return": "void", "signature": "void setGreenplumCSV(GreenplumCSV greenplumCSV)", "testcase": false }, { "class_method_signature": "RequestContext.getOutputFormat()", "constructor": false, "full_signature": "public OutputFormat getOutputFormat()", "identifier": "getOutputFormat", "modifiers": "public", "parameters": "()", "return": "OutputFormat", "signature": "OutputFormat getOutputFormat()", "testcase": false }, { "class_method_signature": "RequestContext.setOutputFormat(OutputFormat outputFormat)", "constructor": false, "full_signature": "public void setOutputFormat(OutputFormat outputFormat)", "identifier": "setOutputFormat", "modifiers": "public", "parameters": "(OutputFormat outputFormat)", "return": "void", "signature": "void setOutputFormat(OutputFormat outputFormat)", "testcase": false }, { "class_method_signature": "RequestContext.getHost()", "constructor": false, "full_signature": "public String getHost()", "identifier": "getHost", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getHost()", "testcase": false }, { "class_method_signature": "RequestContext.setHost(String host)", "constructor": false, "full_signature": "public void setHost(String host)", "identifier": "setHost", "modifiers": "public", "parameters": "(String host)", "return": "void", "signature": "void setHost(String host)", "testcase": false }, { "class_method_signature": "RequestContext.getToken()", "constructor": false, "full_signature": "public String getToken()", "identifier": "getToken", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getToken()", "testcase": false }, { "class_method_signature": "RequestContext.setToken(String token)", "constructor": false, "full_signature": "public void setToken(String token)", "identifier": "setToken", "modifiers": "public", "parameters": "(String token)", "return": "void", "signature": "void setToken(String token)", "testcase": false }, { "class_method_signature": "RequestContext.getStatsMaxFragments()", "constructor": false, "full_signature": "public int getStatsMaxFragments()", "identifier": "getStatsMaxFragments", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int getStatsMaxFragments()", "testcase": false }, { "class_method_signature": "RequestContext.setStatsMaxFragments(int statsMaxFragments)", "constructor": false, "full_signature": "public void setStatsMaxFragments(int statsMaxFragments)", "identifier": "setStatsMaxFragments", "modifiers": "public", "parameters": "(int statsMaxFragments)", "return": "void", "signature": "void setStatsMaxFragments(int statsMaxFragments)", "testcase": false }, { "class_method_signature": "RequestContext.getStatsSampleRatio()", "constructor": false, "full_signature": "public float getStatsSampleRatio()", "identifier": "getStatsSampleRatio", "modifiers": "public", "parameters": "()", "return": "float", "signature": "float getStatsSampleRatio()", "testcase": false }, { "class_method_signature": "RequestContext.setStatsSampleRatio(float statsSampleRatio)", "constructor": false, "full_signature": "public void setStatsSampleRatio(float statsSampleRatio)", "identifier": "setStatsSampleRatio", "modifiers": "public", "parameters": "(float statsSampleRatio)", "return": "void", "signature": "void setStatsSampleRatio(float statsSampleRatio)", "testcase": false }, { "class_method_signature": "RequestContext.validate()", "constructor": false, "full_signature": "public void validate()", "identifier": "validate", "modifiers": "public", "parameters": "()", "return": "void", "signature": "void validate()", "testcase": false }, { "class_method_signature": "RequestContext.ensureNotNull(String property, Object value)", "constructor": false, "full_signature": "private void ensureNotNull(String property, Object value)", "identifier": "ensureNotNull", "modifiers": "private", "parameters": "(String property, Object value)", "return": "void", "signature": "void ensureNotNull(String property, Object value)", "testcase": false }, { "class_method_signature": "RequestContext.fail(String message, Object... args)", "constructor": false, "full_signature": "private void fail(String message, Object... args)", "identifier": "fail", "modifiers": "private", "parameters": "(String message, Object... args)", "return": "void", "signature": "void fail(String message, Object... args)", "testcase": false }, { "class_method_signature": "RequestContext.getPluginConf()", "constructor": false, "full_signature": "public PluginConf getPluginConf()", "identifier": "getPluginConf", "modifiers": "public", "parameters": "()", "return": "PluginConf", "signature": "PluginConf getPluginConf()", "testcase": false }, { "class_method_signature": "RequestContext.setPluginConf(PluginConf pluginConf)", "constructor": false, "full_signature": "public void setPluginConf(PluginConf pluginConf)", "identifier": "setPluginConf", "modifiers": "public", "parameters": "(PluginConf pluginConf)", "return": "void", "signature": "void setPluginConf(PluginConf pluginConf)", "testcase": false }, { "class_method_signature": "RequestContext.getProfileScheme()", "constructor": false, "full_signature": "public String getProfileScheme()", "identifier": "getProfileScheme", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getProfileScheme()", "testcase": false }, { "class_method_signature": "RequestContext.setProfileScheme(String profileScheme)", "constructor": false, "full_signature": "public void setProfileScheme(String profileScheme)", "identifier": "setProfileScheme", "modifiers": "public", "parameters": "(String profileScheme)", "return": "void", "signature": "void setProfileScheme(String profileScheme)", "testcase": false }, { "class_method_signature": "RequestContext.getProtocol()", "constructor": false, "full_signature": "public String getProtocol()", "identifier": "getProtocol", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getProtocol()", "testcase": false }, { "class_method_signature": "RequestContext.setProtocol(String protocol)", "constructor": false, "full_signature": "public void setProtocol(String protocol)", "identifier": "setProtocol", "modifiers": "public", "parameters": "(String protocol)", "return": "void", "signature": "void setProtocol(String protocol)", "testcase": false }, { "class_method_signature": "RequestContext.getAdditionalConfigProps()", "constructor": false, "full_signature": "public Map<String, String> getAdditionalConfigProps()", "identifier": "getAdditionalConfigProps", "modifiers": "public", "parameters": "()", "return": "Map<String, String>", "signature": "Map<String, String> getAdditionalConfigProps()", "testcase": false }, { "class_method_signature": "RequestContext.setAdditionalConfigProps(Map<String, String> additionalConfigProps)", "constructor": false, "full_signature": "public void setAdditionalConfigProps(Map<String, String> additionalConfigProps)", "identifier": "setAdditionalConfigProps", "modifiers": "public", "parameters": "(Map<String, String> additionalConfigProps)", "return": "void", "signature": "void setAdditionalConfigProps(Map<String, String> additionalConfigProps)", "testcase": false }, { "class_method_signature": "RequestContext.getTransactionId()", "constructor": false, "full_signature": "public String getTransactionId()", "identifier": "getTransactionId", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getTransactionId()", "testcase": false }, { "class_method_signature": "RequestContext.setTransactionId(String transactionId)", "constructor": false, "full_signature": "public void setTransactionId(String transactionId)", "identifier": "setTransactionId", "modifiers": "public", "parameters": "(String transactionId)", "return": "void", "signature": "void setTransactionId(String transactionId)", "testcase": false }, { "class_method_signature": "RequestContext.inferProtocolName()", "constructor": false, "full_signature": "private String inferProtocolName()", "identifier": "inferProtocolName", "modifiers": "private", "parameters": "()", "return": "String", "signature": "String inferProtocolName()", "testcase": false }, { "class_method_signature": "RequestContext.inferFormatName()", "constructor": false, "full_signature": "public String inferFormatName()", "identifier": "inferFormatName", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String inferFormatName()", "testcase": false } ], "superclass": "" }
{ "body": "public void setStatsMaxFragments(int statsMaxFragments) {\n this.statsMaxFragments = statsMaxFragments;\n if (statsMaxFragments <= 0) {\n throw new IllegalArgumentException(String\n .format(\"Wrong value '%d'. STATS-MAX-FRAGMENTS must be a positive integer\",\n statsMaxFragments));\n }\n }", "class_method_signature": "RequestContext.setStatsMaxFragments(int statsMaxFragments)", "constructor": false, "full_signature": "public void setStatsMaxFragments(int statsMaxFragments)", "identifier": "setStatsMaxFragments", "invocations": [ "format" ], "modifiers": "public", "parameters": "(int statsMaxFragments)", "return": "void", "signature": "void setStatsMaxFragments(int statsMaxFragments)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_255
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnWrite() {\n context.setTupleDescription(AvroTypeConverter.getColumnDescriptorsFromSchema(testSchema));\n context.setRequestType(RequestContext.RequestType.WRITE_BRIDGE);\n\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifyGeneratedSchema(schema);\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnWrite()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnWrite()", "identifier": "testObtainSchema_OnWrite", "invocations": [ "setTupleDescription", "getColumnDescriptorsFromSchema", "setRequestType", "obtainSchema", "verifyGeneratedSchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnWrite()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_310
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" }, { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "configurationFactory", "modifier": "private", "original_string": "private ConfigurationFactory configurationFactory;", "type": "ConfigurationFactory", "var_name": "configurationFactory" }, { "declarator": "hiveClientWrapper", "modifier": "private", "original_string": "private HiveClientWrapper hiveClientWrapper;", "type": "HiveClientWrapper", "var_name": "hiveClientWrapper" } ], "file": "server/pxf-hive/src/test/java/org/greenplum/pxf/plugins/hive/HiveDataFragmenterTest.java", "identifier": "HiveDataFragmenterTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void constructorCantAccessMetaStore() {\n expectedException.expect(RuntimeException.class);\n expectedException.expectMessage(\"Failed connecting to Hive MetaStore service: which way to albuquerque\");\n\n when(hiveClientWrapper.initHiveClient(context, configuration)).thenThrow(new RuntimeException(\"Failed connecting to Hive MetaStore service: which way to albuquerque\"));\n\n HiveDataFragmenter fragmenter = new HiveDataFragmenter(configurationFactory, hiveClientWrapper);\n fragmenter.initialize(context);\n }", "class_method_signature": "HiveDataFragmenterTest.constructorCantAccessMetaStore()", "constructor": false, "full_signature": "@Test public void constructorCantAccessMetaStore()", "identifier": "constructorCantAccessMetaStore", "invocations": [ "expect", "expectMessage", "thenThrow", "when", "initHiveClient", "initialize" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void constructorCantAccessMetaStore()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(HiveDataFragmenter.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HiveDataFragmenter.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "ALL_PARTS = -1", "modifier": "private static final", "original_string": "private static final short ALL_PARTS = -1;", "type": "short", "var_name": "ALL_PARTS" }, { "declarator": "HIVE_1_PART_DELIM = \"!H1PD!\"", "modifier": "public static final", "original_string": "public static final String HIVE_1_PART_DELIM = \"!H1PD!\";", "type": "String", "var_name": "HIVE_1_PART_DELIM" }, { "declarator": "HIVE_PARTITIONS_DELIM = \"!HPAD!\"", "modifier": "public static final", "original_string": "public static final String HIVE_PARTITIONS_DELIM = \"!HPAD!\";", "type": "String", "var_name": "HIVE_PARTITIONS_DELIM" }, { "declarator": "HIVE_NO_PART_TBL = \"!HNPT!\"", "modifier": "public static final", "original_string": "public static final String HIVE_NO_PART_TBL = \"!HNPT!\";", "type": "String", "var_name": "HIVE_NO_PART_TBL" }, { "declarator": "SUPPORTED_OPERATORS =\n EnumSet.of(\n Operator.EQUALS,\n Operator.LESS_THAN,\n Operator.GREATER_THAN,\n Operator.LESS_THAN_OR_EQUAL,\n Operator.GREATER_THAN_OR_EQUAL,\n Operator.NOT_EQUALS,\n Operator.AND,\n Operator.OR\n )", "modifier": "static final", "original_string": "static final EnumSet<Operator> SUPPORTED_OPERATORS =\n EnumSet.of(\n Operator.EQUALS,\n Operator.LESS_THAN,\n Operator.GREATER_THAN,\n Operator.LESS_THAN_OR_EQUAL,\n Operator.GREATER_THAN_OR_EQUAL,\n Operator.NOT_EQUALS,\n Operator.AND,\n Operator.OR\n );", "type": "EnumSet<Operator>", "var_name": "SUPPORTED_OPERATORS" }, { "declarator": "TRAVERSER = new TreeTraverser()", "modifier": "private static final", "original_string": "private static final TreeTraverser TRAVERSER = new TreeTraverser();", "type": "TreeTraverser", "var_name": "TRAVERSER" }, { "declarator": "client", "modifier": "private", "original_string": "private IMetaStoreClient client;", "type": "IMetaStoreClient", "var_name": "client" }, { "declarator": "hiveClientWrapper", "modifier": "private", "original_string": "private HiveClientWrapper hiveClientWrapper;", "type": "HiveClientWrapper", "var_name": "hiveClientWrapper" }, { "declarator": "filterInFragmenter = false", "modifier": "private", "original_string": "private boolean filterInFragmenter = false;", "type": "boolean", "var_name": "filterInFragmenter" }, { "declarator": "setPartitions = new TreeSet<>(\n String.CASE_INSENSITIVE_ORDER)", "modifier": "private", "original_string": "private Set<String> setPartitions = new TreeSet<>(\n String.CASE_INSENSITIVE_ORDER);", "type": "Set<String>", "var_name": "setPartitions" }, { "declarator": "partitionKeyTypes = new HashMap<>()", "modifier": "private", "original_string": "private Map<String, String> partitionKeyTypes = new HashMap<>();", "type": "Map<String, String>", "var_name": "partitionKeyTypes" } ], "file": "server/pxf-hive/src/main/java/org/greenplum/pxf/plugins/hive/HiveDataFragmenter.java", "identifier": "HiveDataFragmenter", "interfaces": "", "methods": [ { "class_method_signature": "HiveDataFragmenter.HiveDataFragmenter()", "constructor": true, "full_signature": "public HiveDataFragmenter()", "identifier": "HiveDataFragmenter", "modifiers": "public", "parameters": "()", "return": "", "signature": " HiveDataFragmenter()", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.HiveDataFragmenter(ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "constructor": true, "full_signature": " HiveDataFragmenter(ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "identifier": "HiveDataFragmenter", "modifiers": "", "parameters": "(ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "return": "", "signature": " HiveDataFragmenter(ConfigurationFactory configurationFactory, HiveClientWrapper hiveClientWrapper)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.initialize(RequestContext context)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext context)", "identifier": "initialize", "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "void", "signature": "void initialize(RequestContext context)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.getFragments()", "constructor": false, "full_signature": "@Override public List<Fragment> getFragments()", "identifier": "getFragments", "modifiers": "@Override public", "parameters": "()", "return": "List<Fragment>", "signature": "List<Fragment> getFragments()", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.makeInputFormat(String inputFormatName,\n JobConf jobConf)", "constructor": false, "full_signature": "public static InputFormat<?, ?> makeInputFormat(String inputFormatName,\n JobConf jobConf)", "identifier": "makeInputFormat", "modifiers": "public static", "parameters": "(String inputFormatName,\n JobConf jobConf)", "return": "InputFormat<?, ?>", "signature": "InputFormat<?, ?> makeInputFormat(String inputFormatName,\n JobConf jobConf)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.fetchTableMetaData(Metadata.Item tblDesc)", "constructor": false, "full_signature": "private void fetchTableMetaData(Metadata.Item tblDesc)", "identifier": "fetchTableMetaData", "modifiers": "private", "parameters": "(Metadata.Item tblDesc)", "return": "void", "signature": "void fetchTableMetaData(Metadata.Item tblDesc)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.verifySchema(Table tbl)", "constructor": false, "full_signature": " List<Integer> verifySchema(Table tbl)", "identifier": "verifySchema", "modifiers": "", "parameters": "(Table tbl)", "return": "List<Integer>", "signature": "List<Integer> verifySchema(Table tbl)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.getSchema(Table table)", "constructor": false, "full_signature": "private static Properties getSchema(Table table)", "identifier": "getSchema", "modifiers": "private static", "parameters": "(Table table)", "return": "Properties", "signature": "Properties getSchema(Table table)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.fetchMetaDataForSimpleTable(StorageDescriptor stdsc,\n Properties props,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "constructor": false, "full_signature": "private void fetchMetaDataForSimpleTable(StorageDescriptor stdsc,\n Properties props,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "identifier": "fetchMetaDataForSimpleTable", "modifiers": "private", "parameters": "(StorageDescriptor stdsc,\n Properties props,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "return": "void", "signature": "void fetchMetaDataForSimpleTable(StorageDescriptor stdsc,\n Properties props,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.fetchMetaDataForSimpleTable(StorageDescriptor stdsc,\n Properties props,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "constructor": false, "full_signature": "private void fetchMetaDataForSimpleTable(StorageDescriptor stdsc,\n Properties props,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "identifier": "fetchMetaDataForSimpleTable", "modifiers": "private", "parameters": "(StorageDescriptor stdsc,\n Properties props,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "return": "void", "signature": "void fetchMetaDataForSimpleTable(StorageDescriptor stdsc,\n Properties props,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.fetchMetaDataForPartitionedTable(StorageDescriptor stdsc,\n Properties props,\n Partition partition,\n List<FieldSchema> partitionKeys,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "constructor": false, "full_signature": "private void fetchMetaDataForPartitionedTable(StorageDescriptor stdsc,\n Properties props,\n Partition partition,\n List<FieldSchema> partitionKeys,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "identifier": "fetchMetaDataForPartitionedTable", "modifiers": "private", "parameters": "(StorageDescriptor stdsc,\n Properties props,\n Partition partition,\n List<FieldSchema> partitionKeys,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "return": "void", "signature": "void fetchMetaDataForPartitionedTable(StorageDescriptor stdsc,\n Properties props,\n Partition partition,\n List<FieldSchema> partitionKeys,\n String tableName,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.fetchMetaData(HiveTablePartition tablePartition,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "constructor": false, "full_signature": "private void fetchMetaData(HiveTablePartition tablePartition,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "identifier": "fetchMetaData", "modifiers": "private", "parameters": "(HiveTablePartition tablePartition,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "return": "void", "signature": "void fetchMetaData(HiveTablePartition tablePartition,\n boolean hasComplexTypes,\n List<Integer> hiveIndexes,\n String allColumnNames,\n String allColumnTypes)", "testcase": false }, { "class_method_signature": "HiveDataFragmenter.getFragmentStats()", "constructor": false, "full_signature": "@Override public FragmentStats getFragmentStats()", "identifier": "getFragmentStats", "modifiers": "@Override public", "parameters": "()", "return": "FragmentStats", "signature": "FragmentStats getFragmentStats()", "testcase": false } ], "superclass": "extends HdfsDataFragmenter" }
{ "body": "@Override\n public void initialize(RequestContext context) {\n super.initialize(context);\n client = hiveClientWrapper.initHiveClient(this.context, configuration);\n }", "class_method_signature": "HiveDataFragmenter.initialize(RequestContext context)", "constructor": false, "full_signature": "@Override public void initialize(RequestContext context)", "identifier": "initialize", "invocations": [ "initialize", "initHiveClient" ], "modifiers": "@Override public", "parameters": "(RequestContext context)", "return": "void", "signature": "void initialize(RequestContext context)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_185
{ "fields": [ { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/profile/ProfilesConfTest.java", "identifier": "ProfilesConfTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testOptionMappingsTwoMappings() {\n ProfilesConf profilesConf = getProfilesConf(\"optionMappings\");\n Map<String, String> map = profilesConf.getOptionMappings(\"two-mappings\");\n\n assertEquals(2, map.size());\n assertEquals(\"prop1\", map.get(\"option1\"));\n assertEquals(\"prop2\", map.get(\"option2\"));\n }", "class_method_signature": "ProfilesConfTest.testOptionMappingsTwoMappings()", "constructor": false, "full_signature": "@Test public void testOptionMappingsTwoMappings()", "identifier": "testOptionMappingsTwoMappings", "invocations": [ "getProfilesConf", "getOptionMappings", "assertEquals", "size", "assertEquals", "get", "assertEquals", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testOptionMappingsTwoMappings()", "testcase": true }
{ "fields": [ { "declarator": "EXTERNAL_PROFILES = \"pxf-profiles.xml\"", "modifier": "private final static", "original_string": "private final static String EXTERNAL_PROFILES = \"pxf-profiles.xml\";", "type": "String", "var_name": "EXTERNAL_PROFILES" }, { "declarator": "INTERNAL_PROFILES = \"pxf-profiles-default.xml\"", "modifier": "private final static", "original_string": "private final static String INTERNAL_PROFILES = \"pxf-profiles-default.xml\";", "type": "String", "var_name": "INTERNAL_PROFILES" }, { "declarator": "LOG = LoggerFactory.getLogger(ProfilesConf.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(ProfilesConf.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "INSTANCE = new ProfilesConf()", "modifier": "private final static", "original_string": "private final static ProfilesConf INSTANCE = new ProfilesConf();", "type": "ProfilesConf", "var_name": "INSTANCE" }, { "declarator": "externalProfilesFilename", "modifier": "private final", "original_string": "private final String externalProfilesFilename;", "type": "String", "var_name": "externalProfilesFilename" }, { "declarator": "profilesMap", "modifier": "private", "original_string": "private Map<String, Profile> profilesMap;", "type": "Map<String, Profile>", "var_name": "profilesMap" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/profile/ProfilesConf.java", "identifier": "ProfilesConf", "interfaces": "implements PluginConf", "methods": [ { "class_method_signature": "ProfilesConf.ProfilesConf()", "constructor": true, "full_signature": "private ProfilesConf()", "identifier": "ProfilesConf", "modifiers": "private", "parameters": "()", "return": "", "signature": " ProfilesConf()", "testcase": false }, { "class_method_signature": "ProfilesConf.ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "constructor": true, "full_signature": " ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "identifier": "ProfilesConf", "modifiers": "", "parameters": "(String internalProfilesFilename, String externalProfilesFilename)", "return": "", "signature": " ProfilesConf(String internalProfilesFilename, String externalProfilesFilename)", "testcase": false }, { "class_method_signature": "ProfilesConf.getInstance()", "constructor": false, "full_signature": "public static ProfilesConf getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "ProfilesConf", "signature": "ProfilesConf getInstance()", "testcase": false }, { "class_method_signature": "ProfilesConf.getOptionMappings(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getOptionMappings(String profileName)", "identifier": "getOptionMappings", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getOptionMappings(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getPlugins(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getPlugins(String profileName)", "identifier": "getPlugins", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getPlugins(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getProtocol(String profileName)", "constructor": false, "full_signature": "@Override public String getProtocol(String profileName)", "identifier": "getProtocol", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "String", "signature": "String getProtocol(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getHandler(String profileName)", "constructor": false, "full_signature": "@Override public String getHandler(String profileName)", "identifier": "getHandler", "modifiers": "@Override public", "parameters": "(String profileName)", "return": "String", "signature": "String getHandler(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.getProfile(String profileName)", "constructor": false, "full_signature": "private Profile getProfile(String profileName)", "identifier": "getProfile", "modifiers": "private", "parameters": "(String profileName)", "return": "Profile", "signature": "Profile getProfile(String profileName)", "testcase": false }, { "class_method_signature": "ProfilesConf.loadConf(String fileName, boolean isMandatory)", "constructor": false, "full_signature": "private void loadConf(String fileName, boolean isMandatory)", "identifier": "loadConf", "modifiers": "private", "parameters": "(String fileName, boolean isMandatory)", "return": "void", "signature": "void loadConf(String fileName, boolean isMandatory)", "testcase": false }, { "class_method_signature": "ProfilesConf.getClassLoader()", "constructor": false, "full_signature": "private ClassLoader getClassLoader()", "identifier": "getClassLoader", "modifiers": "private", "parameters": "()", "return": "ClassLoader", "signature": "ClassLoader getClassLoader()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public Map<String, String> getOptionMappings(String profileName) {\n return getProfile(profileName).getOptionsMap();\n }", "class_method_signature": "ProfilesConf.getOptionMappings(String profileName)", "constructor": false, "full_signature": "@Override public Map<String, String> getOptionMappings(String profileName)", "identifier": "getOptionMappings", "invocations": [ "getOptionsMap", "getProfile" ], "modifiers": "@Override public", "parameters": "(String profileName)", "return": "Map<String, String>", "signature": "Map<String, String> getOptionMappings(String profileName)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_36
{ "fields": [ { "declarator": "gpCSV", "modifier": "private", "original_string": "private GreenplumCSV gpCSV;", "type": "GreenplumCSV", "var_name": "gpCSV" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/model/GreenplumCSVTest.java", "identifier": "GreenplumCSVTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCsvOptionWithQuoteCharInvalidLength() {\n thrown.expect(IllegalArgumentException.class);\n thrown.expectMessage(\"invalid QUOTE character '\\\"\\\"'. Only single character is allowed for QUOTE.\");\n gpCSV.withQuoteChar(\"\\\"\\\"\");\n }", "class_method_signature": "GreenplumCSVTest.testCsvOptionWithQuoteCharInvalidLength()", "constructor": false, "full_signature": "@Test public void testCsvOptionWithQuoteCharInvalidLength()", "identifier": "testCsvOptionWithQuoteCharInvalidLength", "invocations": [ "expect", "expectMessage", "withQuoteChar" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testCsvOptionWithQuoteCharInvalidLength()", "testcase": true }
{ "fields": [ { "declarator": "QUOTE = '\"'", "modifier": "private static final", "original_string": "private static final char QUOTE = '\"';", "type": "char", "var_name": "QUOTE" }, { "declarator": "ESCAPE = '\"'", "modifier": "private static final", "original_string": "private static final char ESCAPE = '\"';", "type": "char", "var_name": "ESCAPE" }, { "declarator": "DELIMITER = ','", "modifier": "private static final", "original_string": "private static final char DELIMITER = ',';", "type": "char", "var_name": "DELIMITER" }, { "declarator": "NEWLINE = \"\\n\"", "modifier": "private static final", "original_string": "private static final String NEWLINE = \"\\n\";", "type": "String", "var_name": "NEWLINE" }, { "declarator": "VALUE_OF_NULL = \"\"", "modifier": "private static final", "original_string": "private static final String VALUE_OF_NULL = \"\";", "type": "String", "var_name": "VALUE_OF_NULL" }, { "declarator": "valueOfNull", "modifier": "private", "original_string": "private String valueOfNull;", "type": "String", "var_name": "valueOfNull" }, { "declarator": "quote", "modifier": "private", "original_string": "private char quote;", "type": "char", "var_name": "quote" }, { "declarator": "escape", "modifier": "private", "original_string": "private Character escape;", "type": "Character", "var_name": "escape" }, { "declarator": "newline", "modifier": "private", "original_string": "private String newline;", "type": "String", "var_name": "newline" }, { "declarator": "delimiter", "modifier": "private", "original_string": "private Character delimiter;", "type": "Character", "var_name": "delimiter" }, { "declarator": "newlineLength", "modifier": "private", "original_string": "private int newlineLength;", "type": "int", "var_name": "newlineLength" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/model/GreenplumCSV.java", "identifier": "GreenplumCSV", "interfaces": "", "methods": [ { "class_method_signature": "GreenplumCSV.GreenplumCSV()", "constructor": true, "full_signature": "public GreenplumCSV()", "identifier": "GreenplumCSV", "modifiers": "public", "parameters": "()", "return": "", "signature": " GreenplumCSV()", "testcase": false }, { "class_method_signature": "GreenplumCSV.getValueOfNull()", "constructor": false, "full_signature": "public String getValueOfNull()", "identifier": "getValueOfNull", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getValueOfNull()", "testcase": false }, { "class_method_signature": "GreenplumCSV.getQuote()", "constructor": false, "full_signature": "public char getQuote()", "identifier": "getQuote", "modifiers": "public", "parameters": "()", "return": "char", "signature": "char getQuote()", "testcase": false }, { "class_method_signature": "GreenplumCSV.getEscape()", "constructor": false, "full_signature": "public Character getEscape()", "identifier": "getEscape", "modifiers": "public", "parameters": "()", "return": "Character", "signature": "Character getEscape()", "testcase": false }, { "class_method_signature": "GreenplumCSV.getNewline()", "constructor": false, "full_signature": "public String getNewline()", "identifier": "getNewline", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getNewline()", "testcase": false }, { "class_method_signature": "GreenplumCSV.getDelimiter()", "constructor": false, "full_signature": "public Character getDelimiter()", "identifier": "getDelimiter", "modifiers": "public", "parameters": "()", "return": "Character", "signature": "Character getDelimiter()", "testcase": false }, { "class_method_signature": "GreenplumCSV.withValueOfNull(String valueOfNull)", "constructor": false, "full_signature": "public GreenplumCSV withValueOfNull(String valueOfNull)", "identifier": "withValueOfNull", "modifiers": "public", "parameters": "(String valueOfNull)", "return": "GreenplumCSV", "signature": "GreenplumCSV withValueOfNull(String valueOfNull)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withQuoteChar(String quoteString)", "constructor": false, "full_signature": "public GreenplumCSV withQuoteChar(String quoteString)", "identifier": "withQuoteChar", "modifiers": "public", "parameters": "(String quoteString)", "return": "GreenplumCSV", "signature": "GreenplumCSV withQuoteChar(String quoteString)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withQuoteChar(char quoteChar)", "constructor": false, "full_signature": "public GreenplumCSV withQuoteChar(char quoteChar)", "identifier": "withQuoteChar", "modifiers": "public", "parameters": "(char quoteChar)", "return": "GreenplumCSV", "signature": "GreenplumCSV withQuoteChar(char quoteChar)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withEscapeChar(String escapeString)", "constructor": false, "full_signature": "public GreenplumCSV withEscapeChar(String escapeString)", "identifier": "withEscapeChar", "modifiers": "public", "parameters": "(String escapeString)", "return": "GreenplumCSV", "signature": "GreenplumCSV withEscapeChar(String escapeString)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withEscapeChar(char escapeChar)", "constructor": false, "full_signature": "public GreenplumCSV withEscapeChar(char escapeChar)", "identifier": "withEscapeChar", "modifiers": "public", "parameters": "(char escapeChar)", "return": "GreenplumCSV", "signature": "GreenplumCSV withEscapeChar(char escapeChar)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withNewline(String newline)", "constructor": false, "full_signature": "public GreenplumCSV withNewline(String newline)", "identifier": "withNewline", "modifiers": "public", "parameters": "(String newline)", "return": "GreenplumCSV", "signature": "GreenplumCSV withNewline(String newline)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withDelimiter(String delimiterString)", "constructor": false, "full_signature": "public GreenplumCSV withDelimiter(String delimiterString)", "identifier": "withDelimiter", "modifiers": "public", "parameters": "(String delimiterString)", "return": "GreenplumCSV", "signature": "GreenplumCSV withDelimiter(String delimiterString)", "testcase": false }, { "class_method_signature": "GreenplumCSV.withDelimiter(char delimiterChar)", "constructor": false, "full_signature": "public GreenplumCSV withDelimiter(char delimiterChar)", "identifier": "withDelimiter", "modifiers": "public", "parameters": "(char delimiterChar)", "return": "GreenplumCSV", "signature": "GreenplumCSV withDelimiter(char delimiterChar)", "testcase": false }, { "class_method_signature": "GreenplumCSV.validateSingleCharacter(String s, String name)", "constructor": false, "full_signature": "private void validateSingleCharacter(String s, String name)", "identifier": "validateSingleCharacter", "modifiers": "private", "parameters": "(String s, String name)", "return": "void", "signature": "void validateSingleCharacter(String s, String name)", "testcase": false }, { "class_method_signature": "GreenplumCSV.toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar)", "constructor": false, "full_signature": "public String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar)", "identifier": "toCsvField", "modifiers": "public", "parameters": "(String s, boolean prependQuoteChar, boolean appendQuoteChar)", "return": "String", "signature": "String toCsvField(String s, boolean prependQuoteChar, boolean appendQuoteChar)", "testcase": false }, { "class_method_signature": "GreenplumCSV.toCsvField(String s,\n boolean prependQuoteChar,\n boolean appendQuoteChar,\n boolean skipIfQuotingIsNotNeeded)", "constructor": false, "full_signature": "public String toCsvField(String s,\n boolean prependQuoteChar,\n boolean appendQuoteChar,\n boolean skipIfQuotingIsNotNeeded)", "identifier": "toCsvField", "modifiers": "public", "parameters": "(String s,\n boolean prependQuoteChar,\n boolean appendQuoteChar,\n boolean skipIfQuotingIsNotNeeded)", "return": "String", "signature": "String toCsvField(String s,\n boolean prependQuoteChar,\n boolean appendQuoteChar,\n boolean skipIfQuotingIsNotNeeded)", "testcase": false } ], "superclass": "" }
{ "body": "public GreenplumCSV withQuoteChar(String quoteString) {\n if (StringUtils.isNotEmpty(quoteString)) {\n validateSingleCharacter(quoteString, \"QUOTE\");\n withQuoteChar(quoteString.charAt(0));\n }\n return this;\n }", "class_method_signature": "GreenplumCSV.withQuoteChar(String quoteString)", "constructor": false, "full_signature": "public GreenplumCSV withQuoteChar(String quoteString)", "identifier": "withQuoteChar", "invocations": [ "isNotEmpty", "validateSingleCharacter", "withQuoteChar", "charAt" ], "modifiers": "public", "parameters": "(String quoteString)", "return": "GreenplumCSV", "signature": "GreenplumCSV withQuoteChar(String quoteString)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_243
{ "fields": [ { "declarator": "context", "modifier": "private", "original_string": "private RequestContext context;", "type": "RequestContext", "var_name": "context" }, { "declarator": "schema", "modifier": "private", "original_string": "private Schema schema;", "type": "Schema", "var_name": "schema" }, { "declarator": "testSchema", "modifier": "private", "original_string": "private Schema testSchema;", "type": "Schema", "var_name": "testSchema" }, { "declarator": "avroDirectory", "modifier": "private", "original_string": "private String avroDirectory;", "type": "String", "var_name": "avroDirectory" }, { "declarator": "configuration", "modifier": "private", "original_string": "private Configuration configuration;", "type": "Configuration", "var_name": "configuration" }, { "declarator": "avroUtilities", "modifier": "private", "original_string": "private AvroUtilities avroUtilities;", "type": "AvroUtilities", "var_name": "avroUtilities" }, { "declarator": "hcfsType", "modifier": "private", "original_string": "private HcfsType hcfsType;", "type": "HcfsType", "var_name": "hcfsType" }, { "declarator": "expectedException = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException expectedException = ExpectedException.none();", "type": "ExpectedException", "var_name": "expectedException" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilitiesTest.java", "identifier": "AvroUtilitiesTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testObtainSchema_OnRead_WithUserProvidedSchema_Binary_FullPathToLocalFile() {\n context.setRequestType(RequestContext.RequestType.READ_BRIDGE);\n context.addOption(\"SCHEMA\", avroDirectory + \"user-provided.avro\");\n\n schema = avroUtilities.obtainSchema(context, configuration, hcfsType);\n\n verifySchema(schema, \"user_provided_schema\");\n }", "class_method_signature": "AvroUtilitiesTest.testObtainSchema_OnRead_WithUserProvidedSchema_Binary_FullPathToLocalFile()", "constructor": false, "full_signature": "@Test public void testObtainSchema_OnRead_WithUserProvidedSchema_Binary_FullPathToLocalFile()", "identifier": "testObtainSchema_OnRead_WithUserProvidedSchema_Binary_FullPathToLocalFile", "invocations": [ "setRequestType", "addOption", "obtainSchema", "verifySchema" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testObtainSchema_OnRead_WithUserProvidedSchema_Binary_FullPathToLocalFile()", "testcase": true }
{ "fields": [ { "declarator": "COMMON_NAMESPACE = \"public.avro\"", "modifier": "private static", "original_string": "private static String COMMON_NAMESPACE = \"public.avro\";", "type": "String", "var_name": "COMMON_NAMESPACE" }, { "declarator": "fileSearcher", "modifier": "private", "original_string": "private FileSearcher fileSearcher;", "type": "FileSearcher", "var_name": "fileSearcher" }, { "declarator": "schemaPath", "modifier": "private", "original_string": "private String schemaPath;", "type": "String", "var_name": "schemaPath" }, { "declarator": "LOG = LoggerFactory.getLogger(AvroUtilities.class)", "modifier": "private final static", "original_string": "private final static Logger LOG = LoggerFactory.getLogger(AvroUtilities.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance()", "modifier": "", "original_string": "AvroSchemaFileReaderFactory schemaFileReaderFactory = AvroSchemaFileReaderFactory.getInstance();", "type": "AvroSchemaFileReaderFactory", "var_name": "schemaFileReaderFactory" }, { "declarator": "instance = new AvroUtilities()", "modifier": "private static", "original_string": "private static AvroUtilities instance = new AvroUtilities();", "type": "AvroUtilities", "var_name": "instance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/avro/AvroUtilities.java", "identifier": "AvroUtilities", "interfaces": "", "methods": [ { "class_method_signature": "AvroUtilities.AvroUtilities()", "constructor": true, "full_signature": "private AvroUtilities()", "identifier": "AvroUtilities", "modifiers": "private", "parameters": "()", "return": "", "signature": " AvroUtilities()", "testcase": false }, { "class_method_signature": "AvroUtilities.AvroUtilities(FileSearcher fileSearcher)", "constructor": true, "full_signature": " AvroUtilities(FileSearcher fileSearcher)", "identifier": "AvroUtilities", "modifiers": "", "parameters": "(FileSearcher fileSearcher)", "return": "", "signature": " AvroUtilities(FileSearcher fileSearcher)", "testcase": false }, { "class_method_signature": "AvroUtilities.getInstance()", "constructor": false, "full_signature": "public static AvroUtilities getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "AvroUtilities", "signature": "AvroUtilities getInstance()", "testcase": false }, { "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "private Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "readOrGenerateAvroSchema", "modifiers": "private", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema readOrGenerateAvroSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }, { "class_method_signature": "AvroUtilities.readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "constructor": false, "full_signature": "private static Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "identifier": "readSchemaFromAvroDataSource", "modifiers": "private static", "parameters": "(Configuration configuration, String dataSource)", "return": "Schema", "signature": "Schema readSchemaFromAvroDataSource(Configuration configuration, String dataSource)", "testcase": false }, { "class_method_signature": "AvroUtilities.searchForFile(String schemaName)", "constructor": false, "full_signature": "private static File searchForFile(String schemaName)", "identifier": "searchForFile", "modifiers": "private static", "parameters": "(String schemaName)", "return": "File", "signature": "File searchForFile(String schemaName)", "testcase": false }, { "class_method_signature": "AvroUtilities.generateSchema(List<ColumnDescriptor> tupleDescription)", "constructor": false, "full_signature": "private static Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "identifier": "generateSchema", "modifiers": "private static", "parameters": "(List<ColumnDescriptor> tupleDescription)", "return": "Schema", "signature": "Schema generateSchema(List<ColumnDescriptor> tupleDescription)", "testcase": false }, { "class_method_signature": "AvroUtilities.getFieldSchema(DataType type, String colName)", "constructor": false, "full_signature": "private static Schema getFieldSchema(DataType type, String colName)", "identifier": "getFieldSchema", "modifiers": "private static", "parameters": "(DataType type, String colName)", "return": "Schema", "signature": "Schema getFieldSchema(DataType type, String colName)", "testcase": false } ], "superclass": "" }
{ "body": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType) {\n Schema schema = (Schema) context.getMetadata();\n\n if (schema != null) {\n return schema;\n }\n try {\n schemaPath = context.getDataSource();\n schema = readOrGenerateAvroSchema(context, configuration, hcfsType);\n } catch (Exception e) {\n throw new RuntimeException(String.format(\"Failed to obtain Avro schema from '%s'\", schemaPath), e);\n }\n context.setMetadata(schema);\n return schema;\n }", "class_method_signature": "AvroUtilities.obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "constructor": false, "full_signature": "public Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "identifier": "obtainSchema", "invocations": [ "getMetadata", "getDataSource", "readOrGenerateAvroSchema", "format", "setMetadata" ], "modifiers": "public", "parameters": "(RequestContext context, Configuration configuration, HcfsType hcfsType)", "return": "Schema", "signature": "Schema obtainSchema(RequestContext context, Configuration configuration, HcfsType hcfsType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_306
{ "fields": [ { "declarator": "factory", "modifier": "private", "original_string": "private CodecFactory factory;", "type": "CodecFactory", "var_name": "factory" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-hdfs/src/test/java/org/greenplum/pxf/plugins/hdfs/CodecFactoryTest.java", "identifier": "CodecFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void getCodecNoConf() {\n thrown.expect(NullPointerException.class);\n\n String name = \"org.apache.hadoop.io.compress.GzipCodec\";\n factory.getCodec(name, (Configuration) null);\n }", "class_method_signature": "CodecFactoryTest.getCodecNoConf()", "constructor": false, "full_signature": "@Test public void getCodecNoConf()", "identifier": "getCodecNoConf", "invocations": [ "expect", "getCodec" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void getCodecNoConf()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(CodecFactory.class)", "modifier": "private static", "original_string": "private static Logger LOG = LoggerFactory.getLogger(CodecFactory.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "codecFactoryInstance = new CodecFactory()", "modifier": "private static final", "original_string": "private static final CodecFactory codecFactoryInstance = new CodecFactory();", "type": "CodecFactory", "var_name": "codecFactoryInstance" } ], "file": "server/pxf-hdfs/src/main/java/org/greenplum/pxf/plugins/hdfs/CodecFactory.java", "identifier": "CodecFactory", "interfaces": "", "methods": [ { "class_method_signature": "CodecFactory.getCodec(String name, CompressionCodecName defaultCodec)", "constructor": false, "full_signature": "public CompressionCodecName getCodec(String name, CompressionCodecName defaultCodec)", "identifier": "getCodec", "modifiers": "public", "parameters": "(String name, CompressionCodecName defaultCodec)", "return": "CompressionCodecName", "signature": "CompressionCodecName getCodec(String name, CompressionCodecName defaultCodec)", "testcase": false }, { "class_method_signature": "CodecFactory.getCodec(String name, Configuration conf)", "constructor": false, "full_signature": "public CompressionCodec getCodec(String name, Configuration conf)", "identifier": "getCodec", "modifiers": "public", "parameters": "(String name, Configuration conf)", "return": "CompressionCodec", "signature": "CompressionCodec getCodec(String name, Configuration conf)", "testcase": false }, { "class_method_signature": "CodecFactory.getCodecClass(String name, Configuration conf)", "constructor": false, "full_signature": "public Class<? extends CompressionCodec> getCodecClass(String name, Configuration conf)", "identifier": "getCodecClass", "modifiers": "public", "parameters": "(String name, Configuration conf)", "return": "Class<? extends CompressionCodec>", "signature": "Class<? extends CompressionCodec> getCodecClass(String name, Configuration conf)", "testcase": false }, { "class_method_signature": "CodecFactory.getCodecClassByPath(Configuration config, String path)", "constructor": false, "full_signature": "private Class<? extends CompressionCodec> getCodecClassByPath(Configuration config, String path)", "identifier": "getCodecClassByPath", "modifiers": "private", "parameters": "(Configuration config, String path)", "return": "Class<? extends CompressionCodec>", "signature": "Class<? extends CompressionCodec> getCodecClassByPath(Configuration config, String path)", "testcase": false }, { "class_method_signature": "CodecFactory.isCodecThreadSafe(String compCodec, String dataSource, Configuration configuration)", "constructor": false, "full_signature": "public boolean isCodecThreadSafe(String compCodec, String dataSource, Configuration configuration)", "identifier": "isCodecThreadSafe", "modifiers": "public", "parameters": "(String compCodec, String dataSource, Configuration configuration)", "return": "boolean", "signature": "boolean isCodecThreadSafe(String compCodec, String dataSource, Configuration configuration)", "testcase": false }, { "class_method_signature": "CodecFactory.getInstance()", "constructor": false, "full_signature": "public static CodecFactory getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "CodecFactory", "signature": "CodecFactory getInstance()", "testcase": false } ], "superclass": "" }
{ "body": "public CompressionCodecName getCodec(String name, CompressionCodecName defaultCodec) {\n if (name == null) return defaultCodec;\n\n try {\n return CompressionCodecName.fromConf(name);\n } catch (IllegalArgumentException ie) {\n try {\n return CompressionCodecName.fromCompressionCodec(Class.forName(name));\n } catch (ClassNotFoundException ce) {\n throw new IllegalArgumentException(String.format(\"Invalid codec: %s \", name));\n }\n }\n }", "class_method_signature": "CodecFactory.getCodec(String name, CompressionCodecName defaultCodec)", "constructor": false, "full_signature": "public CompressionCodecName getCodec(String name, CompressionCodecName defaultCodec)", "identifier": "getCodec", "invocations": [ "fromConf", "fromCompressionCodec", "forName", "format" ], "modifiers": "public", "parameters": "(String name, CompressionCodecName defaultCodec)", "return": "CompressionCodecName", "signature": "CompressionCodecName getCodec(String name, CompressionCodecName defaultCodec)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_61
{ "fields": [ { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-api/src/test/java/org/greenplum/pxf/api/filter/TreeTraverserTest.java", "identifier": "TreeTraverserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPruningRootNodeDuringVisit() {\n Node root = new Node();\n TreeVisitor visitor = mock(TreeVisitor.class);\n\n when(visitor.before(root, 0)).thenReturn(root);\n\n Node result = new TreeTraverser().traverse(root, visitor);\n\n verify(visitor).before(root, 0);\n verify(visitor).visit(root, 0);\n verify(visitor).after(result, 0);\n verifyNoMoreInteractions(visitor);\n // the root is pruned so we end up with a null result\n assertNull(result);\n }", "class_method_signature": "TreeTraverserTest.testPruningRootNodeDuringVisit()", "constructor": false, "full_signature": "@Test public void testPruningRootNodeDuringVisit()", "identifier": "testPruningRootNodeDuringVisit", "invocations": [ "mock", "thenReturn", "when", "before", "traverse", "before", "verify", "visit", "verify", "after", "verify", "verifyNoMoreInteractions", "assertNull" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testPruningRootNodeDuringVisit()", "testcase": true }
{ "fields": [ { "declarator": "LOG = LoggerFactory.getLogger(TreeTraverser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(TreeTraverser.class);", "type": "Logger", "var_name": "LOG" } ], "file": "server/pxf-api/src/main/java/org/greenplum/pxf/api/filter/TreeTraverser.java", "identifier": "TreeTraverser", "interfaces": "", "methods": [ { "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor... visitors)", "constructor": false, "full_signature": "public Node traverse(Node node, TreeVisitor... visitors)", "identifier": "traverse", "modifiers": "public", "parameters": "(Node node, TreeVisitor... visitors)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor... visitors)", "testcase": false }, { "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor visitor, final int level)", "constructor": false, "full_signature": "protected Node traverse(Node node, TreeVisitor visitor, final int level)", "identifier": "traverse", "modifiers": "protected", "parameters": "(Node node, TreeVisitor visitor, final int level)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor visitor, final int level)", "testcase": false }, { "class_method_signature": "TreeTraverser.traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "constructor": false, "full_signature": "private void traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "identifier": "traverseHelper", "modifiers": "private", "parameters": "(Node node, int index, TreeVisitor visitor, final int level)", "return": "void", "signature": "void traverseHelper(Node node, int index, TreeVisitor visitor, final int level)", "testcase": false } ], "superclass": "" }
{ "body": "public Node traverse(Node node, TreeVisitor... visitors) {\n\n if (ArrayUtils.isEmpty(visitors)) {\n throw new IllegalArgumentException(\"You need to provide at least one visitor for this traverser\");\n }\n\n Node result = node;\n for (TreeVisitor visitor : visitors) {\n result = traverse(result, visitor, 0);\n }\n return result;\n }", "class_method_signature": "TreeTraverser.traverse(Node node, TreeVisitor... visitors)", "constructor": false, "full_signature": "public Node traverse(Node node, TreeVisitor... visitors)", "identifier": "traverse", "invocations": [ "isEmpty", "traverse" ], "modifiers": "public", "parameters": "(Node node, TreeVisitor... visitors)", "return": "Node", "signature": "Node traverse(Node node, TreeVisitor... visitors)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_214
{ "fields": [ { "declarator": "parameters", "modifier": "private", "original_string": "private MultivaluedMap<String, String> parameters;", "type": "MultivaluedMap<String, String>", "var_name": "parameters" }, { "declarator": "parser", "modifier": "private", "original_string": "private HttpRequestParser parser;", "type": "HttpRequestParser", "var_name": "parser" }, { "declarator": "mockRequestHeaders", "modifier": "@Mock\n private", "original_string": "@Mock\n private ContainerRequest mockRequestHeaders;", "type": "ContainerRequest", "var_name": "mockRequestHeaders" }, { "declarator": "mockPluginConf", "modifier": "@Mock\n private", "original_string": "@Mock\n private PluginConf mockPluginConf;", "type": "PluginConf", "var_name": "mockPluginConf" }, { "declarator": "thrown = ExpectedException.none()", "modifier": "@Rule\n public", "original_string": "@Rule\n public ExpectedException thrown = ExpectedException.none();", "type": "ExpectedException", "var_name": "thrown" } ], "file": "server/pxf-service/src/test/java/org/greenplum/pxf/service/HttpRequestParserTest.java", "identifier": "HttpRequestParserTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void protocolIsSetWhenProfileIsSpecified() {\n parameters.putSingle(\"X-GP-OPTIONS-PROFILE\", \"test-profile\");\n when(mockPluginConf.getProtocol(\"test-profile\")).thenReturn(\"test-protocol\");\n\n RequestContext context = parser.parseRequest(mockRequestHeaders, RequestType.FRAGMENTER);\n\n assertEquals(\"test-protocol\", context.getProfileScheme());\n\n }", "class_method_signature": "HttpRequestParserTest.protocolIsSetWhenProfileIsSpecified()", "constructor": false, "full_signature": "@Test public void protocolIsSetWhenProfileIsSpecified()", "identifier": "protocolIsSetWhenProfileIsSpecified", "invocations": [ "putSingle", "thenReturn", "when", "getProtocol", "parseRequest", "assertEquals", "getProfileScheme" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void protocolIsSetWhenProfileIsSpecified()", "testcase": true }
{ "fields": [ { "declarator": "TRUE_LCASE = \"true\"", "modifier": "private static final", "original_string": "private static final String TRUE_LCASE = \"true\";", "type": "String", "var_name": "TRUE_LCASE" }, { "declarator": "FALSE_LCASE = \"false\"", "modifier": "private static final", "original_string": "private static final String FALSE_LCASE = \"false\";", "type": "String", "var_name": "FALSE_LCASE" }, { "declarator": "LOG = LoggerFactory.getLogger(HttpRequestParser.class)", "modifier": "private static final", "original_string": "private static final Logger LOG = LoggerFactory.getLogger(HttpRequestParser.class);", "type": "Logger", "var_name": "LOG" }, { "declarator": "instance = new HttpRequestParser()", "modifier": "private static final", "original_string": "private static final HttpRequestParser instance = new HttpRequestParser();", "type": "HttpRequestParser", "var_name": "instance" }, { "declarator": "PROFILE_SCHEME = \"PROFILE-SCHEME\"", "modifier": "private static final", "original_string": "private static final String PROFILE_SCHEME = \"PROFILE-SCHEME\";", "type": "String", "var_name": "PROFILE_SCHEME" }, { "declarator": "pluginConf", "modifier": "private", "original_string": "private PluginConf pluginConf;", "type": "PluginConf", "var_name": "pluginConf" } ], "file": "server/pxf-service/src/main/java/org/greenplum/pxf/service/HttpRequestParser.java", "identifier": "HttpRequestParser", "interfaces": "implements RequestParser<HttpHeaders>", "methods": [ { "class_method_signature": "HttpRequestParser.HttpRequestParser()", "constructor": true, "full_signature": "public HttpRequestParser()", "identifier": "HttpRequestParser", "modifiers": "public", "parameters": "()", "return": "", "signature": " HttpRequestParser()", "testcase": false }, { "class_method_signature": "HttpRequestParser.HttpRequestParser(PluginConf pluginConf)", "constructor": true, "full_signature": " HttpRequestParser(PluginConf pluginConf)", "identifier": "HttpRequestParser", "modifiers": "", "parameters": "(PluginConf pluginConf)", "return": "", "signature": " HttpRequestParser(PluginConf pluginConf)", "testcase": false }, { "class_method_signature": "HttpRequestParser.getInstance()", "constructor": false, "full_signature": "public static HttpRequestParser getInstance()", "identifier": "getInstance", "modifiers": "public static", "parameters": "()", "return": "HttpRequestParser", "signature": "HttpRequestParser getInstance()", "testcase": false }, { "class_method_signature": "HttpRequestParser.protocolViolation(String property)", "constructor": false, "full_signature": "private static void protocolViolation(String property)", "identifier": "protocolViolation", "modifiers": "private static", "parameters": "(String property)", "return": "void", "signature": "void protocolViolation(String property)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseGreenplumCSV(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseGreenplumCSV(RequestMap params, RequestContext context)", "identifier": "parseGreenplumCSV", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseGreenplumCSV(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.addProfilePlugins(String profile, RequestMap params)", "constructor": false, "full_signature": "private void addProfilePlugins(String profile, RequestMap params)", "identifier": "addProfilePlugins", "modifiers": "private", "parameters": "(String profile, RequestMap params)", "return": "void", "signature": "void addProfilePlugins(String profile, RequestMap params)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseBooleanValue(String threadSafeStr)", "constructor": false, "full_signature": "private boolean parseBooleanValue(String threadSafeStr)", "identifier": "parseBooleanValue", "modifiers": "private", "parameters": "(String threadSafeStr)", "return": "boolean", "signature": "boolean parseBooleanValue(String threadSafeStr)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTupleDescription(RequestMap params, RequestContext context)", "constructor": false, "full_signature": "private void parseTupleDescription(RequestMap params, RequestContext context)", "identifier": "parseTupleDescription", "modifiers": "private", "parameters": "(RequestMap params, RequestContext context)", "return": "void", "signature": "void parseTupleDescription(RequestMap params, RequestContext context)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parseTypeMods(RequestMap params, int columnIndex)", "constructor": false, "full_signature": "private Integer[] parseTypeMods(RequestMap params, int columnIndex)", "identifier": "parseTypeMods", "modifiers": "private", "parameters": "(RequestMap params, int columnIndex)", "return": "Integer[]", "signature": "Integer[] parseTypeMods(RequestMap params, int columnIndex)", "testcase": false }, { "class_method_signature": "HttpRequestParser.parsePositiveIntOrError(String s, String propName)", "constructor": false, "full_signature": "private int parsePositiveIntOrError(String s, String propName)", "identifier": "parsePositiveIntOrError", "modifiers": "private", "parameters": "(String s, String propName)", "return": "int", "signature": "int parsePositiveIntOrError(String s, String propName)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType) {\n\n RequestMap params = new RequestMap(request.getRequestHeaders());\n\n if (LOG.isDebugEnabled()) {\n // Logging only keys to prevent sensitive data to be logged\n LOG.debug(\"Parsing request parameters: \" + params.keySet());\n }\n\n // build new instance of RequestContext and fill it with parsed values\n RequestContext context = new RequestContext();\n\n // whether we are in a fragmenter, read_bridge, or write_bridge scenario\n context.setRequestType(requestType);\n\n // first of all, set profile and enrich parameters with information from specified profile\n String profile = params.removeUserProperty(\"PROFILE\");\n context.setProfile(profile);\n addProfilePlugins(profile, params);\n\n // Ext table uses system property FORMAT for wire serialization format\n String wireFormat = params.removeProperty(\"FORMAT\");\n context.setOutputFormat(OutputFormat.valueOf(wireFormat));\n\n // FDW uses user property FORMAT to indicate format of data\n String format = params.removeUserProperty(\"FORMAT\");\n format = StringUtils.isNotBlank(format) ? format : context.inferFormatName();\n context.setFormat(format);\n\n context.setAccessor(params.removeUserProperty(\"ACCESSOR\"));\n context.setAggType(EnumAggregationType.getAggregationType(params.removeOptionalProperty(\"AGG-TYPE\")));\n\n /*\n * Some resources don't require a fragment, hence the list can be empty.\n */\n String fragmentStr = params.removeOptionalProperty(\"DATA-FRAGMENT\");\n if (StringUtils.isNotBlank(fragmentStr)) {\n context.setDataFragment(Integer.parseInt(fragmentStr));\n }\n\n context.setDataSource(params.removeProperty(\"DATA-DIR\"));\n\n String filterString = params.removeOptionalProperty(\"FILTER\");\n String hasFilter = params.removeProperty(\"HAS-FILTER\");\n if (filterString != null) {\n context.setFilterString(filterString);\n } else if (\"1\".equals(hasFilter)) {\n LOG.info(\"Original query has filter, but it was not propagated to PXF\");\n }\n\n context.setFragmenter(params.removeUserProperty(\"FRAGMENTER\"));\n\n String fragmentIndexStr = params.removeOptionalProperty(\"FRAGMENT-INDEX\");\n if (StringUtils.isNotBlank(fragmentIndexStr)) {\n context.setFragmentIndex(Integer.parseInt(fragmentIndexStr));\n }\n\n String encodedFragmentMetadata = params.removeOptionalProperty(\"FRAGMENT-METADATA\");\n context.setFragmentMetadata(Utilities.parseBase64(encodedFragmentMetadata, \"Fragment metadata information\"));\n context.setHost(params.removeProperty(\"URL-HOST\"));\n context.setMetadata(params.removeUserProperty(\"METADATA\"));\n context.setPort(params.removeIntProperty(\"URL-PORT\"));\n context.setProfileScheme(params.removeUserProperty(PROFILE_SCHEME));\n context.setProtocol(params.removeUserProperty(\"PROTOCOL\"));\n context.setRemoteLogin(params.removeOptionalProperty(\"REMOTE-USER\"));\n context.setRemoteSecret(params.removeOptionalProperty(\"REMOTE-PASS\"));\n context.setResolver(params.removeUserProperty(\"RESOLVER\"));\n context.setSegmentId(params.removeIntProperty(\"SEGMENT-ID\"));\n context.setServerName(params.removeUserProperty(\"SERVER\"));\n\n // An optional CONFIG value specifies the name of the server\n // configuration directory, if not provided the config is the server name\n String config = params.removeUserProperty(\"CONFIG\");\n context.setConfig(StringUtils.isNotBlank(config) ? config : context.getServerName());\n\n String maxFrags = params.removeUserProperty(\"STATS-MAX-FRAGMENTS\");\n if (!StringUtils.isBlank(maxFrags)) {\n context.setStatsMaxFragments(Integer.parseInt(maxFrags));\n }\n\n String sampleRatioStr = params.removeUserProperty(\"STATS-SAMPLE-RATIO\");\n if (!StringUtils.isBlank(sampleRatioStr)) {\n context.setStatsSampleRatio(Float.parseFloat(sampleRatioStr));\n }\n\n context.setTotalSegments(params.removeIntProperty(\"SEGMENT-COUNT\"));\n context.setTransactionId(params.removeProperty(\"XID\"));\n\n // parse tuple description\n parseTupleDescription(params, context);\n\n if (context.getOutputFormat() == OutputFormat.TEXT) {\n // parse CSV format information\n parseGreenplumCSV(params, context);\n\n // Only single column tables support 'OFF' delimiter\n if (context.getTupleDescription().size() != 1 && context.getGreenplumCSV().getDelimiter() == null) {\n throw new IllegalArgumentException(String.format(\"using no delimiter is only possible for a single column table. %d columns found\", context.getTupleDescription().size()));\n }\n }\n\n context.setUser(params.removeProperty(\"USER\"));\n\n String encodedFragmentUserData = params.removeOptionalProperty(\"FRAGMENT-USER-DATA\");\n context.setUserData(Utilities.parseBase64(encodedFragmentUserData, \"Fragment user data\"));\n\n // Store alignment for global use as a system property\n System.setProperty(\"greenplum.alignment\", params.removeProperty(\"ALIGNMENT\"));\n\n Map<String, String> optionMappings = null;\n\n // prepare addition configuration properties if profile was specified\n if (StringUtils.isNotBlank(profile)) {\n optionMappings = pluginConf.getOptionMappings(profile);\n }\n\n // use empty map for convenience instead of null\n if (optionMappings == null) {\n optionMappings = Collections.emptyMap();\n }\n\n Map<String, String> additionalConfigProps = new HashMap<>();\n\n // Iterate over the remaining properties\n // we clone the keyset to prevent concurrent modification exceptions\n List<String> paramNames = new ArrayList<>(params.keySet());\n for (String param : paramNames) {\n if (StringUtils.startsWithIgnoreCase(param, RequestMap.USER_PROP_PREFIX)) {\n // Add all left-over user properties as options\n String optionName = param.toLowerCase().replace(RequestMap.USER_PROP_PREFIX_LOWERCASE, \"\");\n String optionValue = params.removeUserProperty(optionName);\n context.addOption(optionName, optionValue);\n LOG.debug(\"Added option {} to request context\", optionName);\n\n // lookup if the option should also be applied as a config property\n String propertyName = optionMappings.get(optionName);\n if (StringUtils.isNotBlank(propertyName)) {\n // if option has been provided by the user in the request, set the value\n // of the corresponding configuration property\n if (optionValue != null) {\n additionalConfigProps.put(propertyName, optionValue);\n // do not log property value as it might contain sensitive information\n LOG.debug(\"Added extra config property {} from option {}\", propertyName, optionName);\n }\n }\n } else if (StringUtils.startsWithIgnoreCase(param, RequestMap.PROP_PREFIX)) {\n // log debug for all left-over system properties\n LOG.debug(\"Unused property {}\", param);\n }\n }\n\n context.setAdditionalConfigProps(additionalConfigProps);\n context.setPluginConf(pluginConf);\n\n // Call the protocol handler for any protocol-specific logic handling\n if (StringUtils.isNotBlank(profile)) {\n String handlerClassName = pluginConf.getHandler(profile);\n if (StringUtils.isNotBlank(handlerClassName)) {\n Class<?> clazz;\n try {\n clazz = Class.forName(handlerClassName);\n ProtocolHandler handler = (ProtocolHandler) clazz.getDeclaredConstructor().newInstance();\n context.setFragmenter(handler.getFragmenterClassName(context));\n context.setAccessor(handler.getAccessorClassName(context));\n context.setResolver(handler.getResolverClassName(context));\n } catch (ClassNotFoundException | NoSuchMethodException | InvocationTargetException |\n InstantiationException | IllegalAccessException e) {\n throw new RuntimeException(String.format(\"Error when invoking handlerClass '%s' : %s\", handlerClassName, e), e);\n }\n }\n }\n\n // validate that the result has all required fields, and values are in valid ranges\n context.validate();\n\n return context;\n }", "class_method_signature": "HttpRequestParser.parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "constructor": false, "full_signature": "@Override public RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "identifier": "parseRequest", "invocations": [ "getRequestHeaders", "isDebugEnabled", "debug", "keySet", "setRequestType", "removeUserProperty", "setProfile", "addProfilePlugins", "removeProperty", "setOutputFormat", "valueOf", "removeUserProperty", "isNotBlank", "inferFormatName", "setFormat", "setAccessor", "removeUserProperty", "setAggType", "getAggregationType", "removeOptionalProperty", "removeOptionalProperty", "isNotBlank", "setDataFragment", "parseInt", "setDataSource", "removeProperty", "removeOptionalProperty", "removeProperty", "setFilterString", "equals", "info", "setFragmenter", "removeUserProperty", "removeOptionalProperty", "isNotBlank", "setFragmentIndex", "parseInt", "removeOptionalProperty", "setFragmentMetadata", "parseBase64", "setHost", "removeProperty", "setMetadata", "removeUserProperty", "setPort", "removeIntProperty", "setProfileScheme", "removeUserProperty", "setProtocol", "removeUserProperty", "setRemoteLogin", "removeOptionalProperty", "setRemoteSecret", "removeOptionalProperty", "setResolver", "removeUserProperty", "setSegmentId", "removeIntProperty", "setServerName", "removeUserProperty", "removeUserProperty", "setConfig", "isNotBlank", "getServerName", "removeUserProperty", "isBlank", "setStatsMaxFragments", "parseInt", "removeUserProperty", "isBlank", "setStatsSampleRatio", "parseFloat", "setTotalSegments", "removeIntProperty", "setTransactionId", "removeProperty", "parseTupleDescription", "getOutputFormat", "parseGreenplumCSV", "size", "getTupleDescription", "getDelimiter", "getGreenplumCSV", "format", "size", "getTupleDescription", "setUser", "removeProperty", "removeOptionalProperty", "setUserData", "parseBase64", "setProperty", "removeProperty", "isNotBlank", "getOptionMappings", "emptyMap", "keySet", "startsWithIgnoreCase", "replace", "toLowerCase", "removeUserProperty", "addOption", "debug", "get", "isNotBlank", "put", "debug", "startsWithIgnoreCase", "debug", "setAdditionalConfigProps", "setPluginConf", "isNotBlank", "getHandler", "isNotBlank", "forName", "newInstance", "getDeclaredConstructor", "setFragmenter", "getFragmenterClassName", "setAccessor", "getAccessorClassName", "setResolver", "getResolverClassName", "format", "validate" ], "modifiers": "@Override public", "parameters": "(HttpHeaders request, RequestContext.RequestType requestType)", "return": "RequestContext", "signature": "RequestContext parseRequest(HttpHeaders request, RequestContext.RequestType requestType)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
146510094_351
{ "fields": [], "file": "server/pxf-jdbc/src/test/java/org/greenplum/pxf/plugins/jdbc/utils/HiveJdbcUtilsTest.java", "identifier": "HiveJdbcUtilsTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testURLWithoutImpersonationProperty() throws Exception {\n String url = \"jdbc:hive2://server:10000/default;foo=bar;saslQop=auth-conf\";\n assertEquals(\"jdbc:hive2://server:10000/default;foo=bar;saslQop=auth-conf;hive.server2.proxy.user=foo\",\n HiveJdbcUtils.updateImpersonationPropertyInHiveJdbcUrl(url, \"foo\"));\n }", "class_method_signature": "HiveJdbcUtilsTest.testURLWithoutImpersonationProperty()", "constructor": false, "full_signature": "@Test public void testURLWithoutImpersonationProperty()", "identifier": "testURLWithoutImpersonationProperty", "invocations": [ "assertEquals", "updateImpersonationPropertyInHiveJdbcUrl" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testURLWithoutImpersonationProperty()", "testcase": true }
{ "fields": [ { "declarator": "HIVE_URL_IMPERSONATION_PROPERTY = \";hive.server2.proxy.user\"", "modifier": "private static final", "original_string": "private static final String HIVE_URL_IMPERSONATION_PROPERTY = \";hive.server2.proxy.user\";", "type": "String", "var_name": "HIVE_URL_IMPERSONATION_PROPERTY" }, { "declarator": "TERMINATORS_THREE_CHARS = Sets.newHashSet(';', '?', '#')", "modifier": "private static final", "original_string": "private static final Set<Character> TERMINATORS_THREE_CHARS = Sets.newHashSet(';', '?', '#');", "type": "Set<Character>", "var_name": "TERMINATORS_THREE_CHARS" }, { "declarator": "TERMINATORS_TWO_CHARS = Sets.newHashSet('?', '#')", "modifier": "private static final", "original_string": "private static final Set<Character> TERMINATORS_TWO_CHARS = Sets.newHashSet('?', '#');", "type": "Set<Character>", "var_name": "TERMINATORS_TWO_CHARS" } ], "file": "server/pxf-jdbc/src/main/java/org/greenplum/pxf/plugins/jdbc/utils/HiveJdbcUtils.java", "identifier": "HiveJdbcUtils", "interfaces": "", "methods": [ { "class_method_signature": "HiveJdbcUtils.updateImpersonationPropertyInHiveJdbcUrl(String url, String user)", "constructor": false, "full_signature": "public static String updateImpersonationPropertyInHiveJdbcUrl(String url, String user)", "identifier": "updateImpersonationPropertyInHiveJdbcUrl", "modifiers": "public static", "parameters": "(String url, String user)", "return": "String", "signature": "String updateImpersonationPropertyInHiveJdbcUrl(String url, String user)", "testcase": false }, { "class_method_signature": "HiveJdbcUtils.findTerminatorIndex(String s, int start, Set<Character> terminators)", "constructor": false, "full_signature": "private static int findTerminatorIndex(String s, int start, Set<Character> terminators)", "identifier": "findTerminatorIndex", "modifiers": "private static", "parameters": "(String s, int start, Set<Character> terminators)", "return": "int", "signature": "int findTerminatorIndex(String s, int start, Set<Character> terminators)", "testcase": false } ], "superclass": "" }
{ "body": "public static String updateImpersonationPropertyInHiveJdbcUrl(String url, String user) {\n String suffix, prefix = null;\n int terminatorIndex = findTerminatorIndex(url, 0, TERMINATORS_TWO_CHARS);\n\n // impersonation property might already be in the URL\n int impersonationPropertyIndex = url.indexOf(HIVE_URL_IMPERSONATION_PROPERTY);\n if (impersonationPropertyIndex > -1 && (terminatorIndex == -1 || impersonationPropertyIndex < terminatorIndex)) {\n // unlikely to happen, unless users are trying to hack the system and provide this property in the DDL\n prefix = url.substring(0, impersonationPropertyIndex);\n\n // find where the token terminates (by ; ? # or EOL, whatever comes first)\n terminatorIndex = findTerminatorIndex(url, impersonationPropertyIndex + HIVE_URL_IMPERSONATION_PROPERTY.length(), TERMINATORS_THREE_CHARS);\n }\n\n suffix = terminatorIndex < 0 ? \"\" : url.substring(terminatorIndex);\n\n if (prefix == null) {\n // when the HIVE_URL_IMPERSONATION_PROPERTY is not present\n prefix = terminatorIndex < 0 ? url : url.substring(0, terminatorIndex);\n }\n\n return String.format(\"%s%s=%s%s\", StringUtils.removeEnd(prefix, \";\"), HIVE_URL_IMPERSONATION_PROPERTY, user, suffix);\n }", "class_method_signature": "HiveJdbcUtils.updateImpersonationPropertyInHiveJdbcUrl(String url, String user)", "constructor": false, "full_signature": "public static String updateImpersonationPropertyInHiveJdbcUrl(String url, String user)", "identifier": "updateImpersonationPropertyInHiveJdbcUrl", "invocations": [ "findTerminatorIndex", "indexOf", "substring", "findTerminatorIndex", "length", "substring", "substring", "format", "removeEnd" ], "modifiers": "public static", "parameters": "(String url, String user)", "return": "String", "signature": "String updateImpersonationPropertyInHiveJdbcUrl(String url, String user)", "testcase": false }
{ "created": "8/28/2018 9:42:19 PM +00:00", "fork": "False", "fork_count": null, "is_fork": null, "language": null, "license": "licensed", "repo_id": 146510094, "size": null, "stargazer_count": null, "stars": 14, "updates": "2020-01-25T19:21:50+00:00", "url": "https://github.com/greenplum-db/pxf" }
34568856_0
{ "fields": [], "file": "app/src/test/java/com/garethevans/church/opensongtablet/StorageAccessTest.java", "identifier": "StorageAccessTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void safeFilename() {\n String input = \"This is a <*bad*> /Filename\\\\ & who knows what it wull do!! # $ + \\\" ' { } : @ \";\n String output;\n String expected = \"This is a bad Filename who knows what it wull do\";\n\n StorageAccess storageAccess = new StorageAccess();\n output = storageAccess.safeFilename(input);\n\n assertEquals(expected,output);\n }", "class_method_signature": "StorageAccessTest.safeFilename()", "constructor": false, "full_signature": "@Test public void safeFilename()", "identifier": "safeFilename", "invocations": [ "safeFilename", "assertEquals" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void safeFilename()", "testcase": true }
{ "fields": [ { "declarator": "appFolder = \"OpenSong\"", "modifier": "final", "original_string": "final String appFolder = \"OpenSong\";", "type": "String", "var_name": "appFolder" }, { "declarator": "uriTree = null", "modifier": "private", "original_string": "private Uri uriTree = null, uriTreeHome = null;", "type": "Uri", "var_name": "uriTree" }, { "declarator": "rootFolders = {\"Backgrounds\", \"Export\", \"Highlighter\", \"Images\", \"Media\",\n \"Notes\", \"OpenSong Scripture\", \"Pads\", \"Profiles\", \"Received\", \"Scripture\",\n \"Sets\", \"Settings\", \"Slides\", \"Songs\", \"Variations\"}", "modifier": "private final", "original_string": "private final String[] rootFolders = {\"Backgrounds\", \"Export\", \"Highlighter\", \"Images\", \"Media\",\n \"Notes\", \"OpenSong Scripture\", \"Pads\", \"Profiles\", \"Received\", \"Scripture\",\n \"Sets\", \"Settings\", \"Slides\", \"Songs\", \"Variations\"};", "type": "String[]", "var_name": "rootFolders" }, { "declarator": "cacheFolders = {\"Backgrounds/_cache\", \"Images/_cache\", \"Notes/_cache\",\n \"OpenSong Scripture/_cache\", \"Scripture/_cache\", \"Slides/_cache\"}", "modifier": "private final", "original_string": "private final String[] cacheFolders = {\"Backgrounds/_cache\", \"Images/_cache\", \"Notes/_cache\",\n \"OpenSong Scripture/_cache\", \"Scripture/_cache\", \"Slides/_cache\"};", "type": "String[]", "var_name": "cacheFolders" } ], "file": "app/src/main/java/com/garethevans/church/opensongtablet/StorageAccess.java", "identifier": "StorageAccess", "interfaces": "", "methods": [ { "class_method_signature": "StorageAccess.getStoragePreference(Context c, Preferences preferences)", "constructor": false, "full_signature": "private String getStoragePreference(Context c, Preferences preferences)", "identifier": "getStoragePreference", "modifiers": "private", "parameters": "(Context c, Preferences preferences)", "return": "String", "signature": "String getStoragePreference(Context c, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.homeFolder(Context c, Uri uri, Preferences preferences)", "constructor": false, "full_signature": " Uri homeFolder(Context c, Uri uri, Preferences preferences)", "identifier": "homeFolder", "modifiers": "", "parameters": "(Context c, Uri uri, Preferences preferences)", "return": "Uri", "signature": "Uri homeFolder(Context c, Uri uri, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.homeFolder_SAF(Context c, String uriTree_String)", "constructor": false, "full_signature": "private Uri homeFolder_SAF(Context c, String uriTree_String)", "identifier": "homeFolder_SAF", "modifiers": "private", "parameters": "(Context c, String uriTree_String)", "return": "Uri", "signature": "Uri homeFolder_SAF(Context c, String uriTree_String)", "testcase": false }, { "class_method_signature": "StorageAccess.homeFolder_File(String uriTree_String)", "constructor": false, "full_signature": "private Uri homeFolder_File(String uriTree_String)", "identifier": "homeFolder_File", "modifiers": "private", "parameters": "(String uriTree_String)", "return": "Uri", "signature": "Uri homeFolder_File(String uriTree_String)", "testcase": false }, { "class_method_signature": "StorageAccess.stringForFile(Context c, Preferences preferences, String folderpath)", "constructor": false, "full_signature": "private String stringForFile(Context c, Preferences preferences, String folderpath)", "identifier": "stringForFile", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String folderpath)", "return": "String", "signature": "String stringForFile(Context c, Preferences preferences, String folderpath)", "testcase": false }, { "class_method_signature": "StorageAccess.createOrCheckRootFolders(Context c, Uri uri, Preferences preferences)", "constructor": false, "full_signature": "@TargetApi(Build.VERSION_CODES.LOLLIPOP) String createOrCheckRootFolders(Context c, Uri uri, Preferences preferences)", "identifier": "createOrCheckRootFolders", "modifiers": "@TargetApi(Build.VERSION_CODES.LOLLIPOP)", "parameters": "(Context c, Uri uri, Preferences preferences)", "return": "String", "signature": "String createOrCheckRootFolders(Context c, Uri uri, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.createOrCheckRootFolders_File(Context c, Preferences preferences)", "constructor": false, "full_signature": "private String createOrCheckRootFolders_File(Context c, Preferences preferences)", "identifier": "createOrCheckRootFolders_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences)", "return": "String", "signature": "String createOrCheckRootFolders_File(Context c, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.createOrCheckRootFolders_SAF(Context c, Uri uri, Preferences preferences)", "constructor": false, "full_signature": "@SuppressWarnings(\"SameReturnValue\") @TargetApi(Build.VERSION_CODES.LOLLIPOP) private String createOrCheckRootFolders_SAF(Context c, Uri uri, Preferences preferences)", "identifier": "createOrCheckRootFolders_SAF", "modifiers": "@SuppressWarnings(\"SameReturnValue\") @TargetApi(Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Context c, Uri uri, Preferences preferences)", "return": "String", "signature": "String createOrCheckRootFolders_SAF(Context c, Uri uri, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.copyAssets(Context c, Preferences preferences)", "constructor": false, "full_signature": "private void copyAssets(Context c, Preferences preferences)", "identifier": "copyAssets", "modifiers": "private", "parameters": "(Context c, Preferences preferences)", "return": "void", "signature": "void copyAssets(Context c, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.getFileProviderUri(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": " Uri getFileProviderUri(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "getFileProviderUri", "modifiers": "", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "Uri", "signature": "Uri getFileProviderUri(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.getFileProviderUri_SAF(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "private Uri getFileProviderUri_SAF(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "getFileProviderUri_SAF", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "Uri", "signature": "Uri getFileProviderUri_SAF(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.getFileProviderUri_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "private Uri getFileProviderUri_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "getFileProviderUri_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "Uri", "signature": "Uri getFileProviderUri_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.documentFileFromRootUri(Context c, Uri uri, String path)", "constructor": false, "full_signature": " DocumentFile documentFileFromRootUri(Context c, Uri uri, String path)", "identifier": "documentFileFromRootUri", "modifiers": "", "parameters": "(Context c, Uri uri, String path)", "return": "DocumentFile", "signature": "DocumentFile documentFileFromRootUri(Context c, Uri uri, String path)", "testcase": false }, { "class_method_signature": "StorageAccess.documentFileFromUri(Context c, Uri uri, String path)", "constructor": false, "full_signature": "private DocumentFile documentFileFromUri(Context c, Uri uri, String path)", "identifier": "documentFileFromUri", "modifiers": "private", "parameters": "(Context c, Uri uri, String path)", "return": "DocumentFile", "signature": "DocumentFile documentFileFromUri(Context c, Uri uri, String path)", "testcase": false }, { "class_method_signature": "StorageAccess.getDocumentsContractId(Uri uri)", "constructor": false, "full_signature": "@SuppressLint(\"NewApi\") private String getDocumentsContractId(Uri uri)", "identifier": "getDocumentsContractId", "modifiers": "@SuppressLint(\"NewApi\") private", "parameters": "(Uri uri)", "return": "String", "signature": "String getDocumentsContractId(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.getChildren(Uri uri, String id)", "constructor": false, "full_signature": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private Uri getChildren(Uri uri, String id)", "identifier": "getChildren", "modifiers": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Uri uri, String id)", "return": "Uri", "signature": "Uri getChildren(Uri uri, String id)", "testcase": false }, { "class_method_signature": "StorageAccess.copyFile(InputStream in, OutputStream out)", "constructor": false, "full_signature": " boolean copyFile(InputStream in, OutputStream out)", "identifier": "copyFile", "modifiers": "", "parameters": "(InputStream in, OutputStream out)", "return": "boolean", "signature": "boolean copyFile(InputStream in, OutputStream out)", "testcase": false }, { "class_method_signature": "StorageAccess.writeFileFromString(String s, OutputStream os)", "constructor": false, "full_signature": " boolean writeFileFromString(String s, OutputStream os)", "identifier": "writeFileFromString", "modifiers": "", "parameters": "(String s, OutputStream os)", "return": "boolean", "signature": "boolean writeFileFromString(String s, OutputStream os)", "testcase": false }, { "class_method_signature": "StorageAccess.writeFileFromDecodedImageString(OutputStream os, byte[] bytes)", "constructor": false, "full_signature": " void writeFileFromDecodedImageString(OutputStream os, byte[] bytes)", "identifier": "writeFileFromDecodedImageString", "modifiers": "", "parameters": "(OutputStream os, byte[] bytes)", "return": "void", "signature": "void writeFileFromDecodedImageString(OutputStream os, byte[] bytes)", "testcase": false }, { "class_method_signature": "StorageAccess.writeImage(OutputStream outputStream, Bitmap bmp)", "constructor": false, "full_signature": " void writeImage(OutputStream outputStream, Bitmap bmp)", "identifier": "writeImage", "modifiers": "", "parameters": "(OutputStream outputStream, Bitmap bmp)", "return": "void", "signature": "void writeImage(OutputStream outputStream, Bitmap bmp)", "testcase": false }, { "class_method_signature": "StorageAccess.readTextFileToString(InputStream in)", "constructor": false, "full_signature": " String readTextFileToString(InputStream in)", "identifier": "readTextFileToString", "modifiers": "", "parameters": "(InputStream in)", "return": "String", "signature": "String readTextFileToString(InputStream in)", "testcase": false }, { "class_method_signature": "StorageAccess.getInputStream(Context c, Uri uri)", "constructor": false, "full_signature": " InputStream getInputStream(Context c, Uri uri)", "identifier": "getInputStream", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "InputStream", "signature": "InputStream getInputStream(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.getOutputStream(Context c, Uri uri)", "constructor": false, "full_signature": " OutputStream getOutputStream(Context c, Uri uri)", "identifier": "getOutputStream", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "OutputStream", "signature": "OutputStream getOutputStream(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.lollipopCreateFileForOutputStream(Context c, Preferences preferences, Uri uri, String mimeType, String folder, String subfolder, String filename)", "constructor": false, "full_signature": " void lollipopCreateFileForOutputStream(Context c, Preferences preferences, Uri uri, String mimeType, String folder, String subfolder, String filename)", "identifier": "lollipopCreateFileForOutputStream", "modifiers": "", "parameters": "(Context c, Preferences preferences, Uri uri, String mimeType, String folder, String subfolder, String filename)", "return": "void", "signature": "void lollipopCreateFileForOutputStream(Context c, Preferences preferences, Uri uri, String mimeType, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.lollipopOrLater()", "constructor": false, "full_signature": " boolean lollipopOrLater()", "identifier": "lollipopOrLater", "modifiers": "", "parameters": "()", "return": "boolean", "signature": "boolean lollipopOrLater()", "testcase": false }, { "class_method_signature": "StorageAccess.listSongs(Context c, Preferences preferences)", "constructor": false, "full_signature": "@SuppressLint(\"NewApi\") ArrayList<String> listSongs(Context c, Preferences preferences)", "identifier": "listSongs", "modifiers": "@SuppressLint(\"NewApi\")", "parameters": "(Context c, Preferences preferences)", "return": "ArrayList<String>", "signature": "ArrayList<String> listSongs(Context c, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.listSongs_SAF(Context c, Preferences preferences)", "constructor": false, "full_signature": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private ArrayList<String> listSongs_SAF(Context c, Preferences preferences)", "identifier": "listSongs_SAF", "modifiers": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Context c, Preferences preferences)", "return": "ArrayList<String>", "signature": "ArrayList<String> listSongs_SAF(Context c, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.listSongs_File(Context c, Preferences preferences)", "constructor": false, "full_signature": "private ArrayList<String> listSongs_File(Context c, Preferences preferences)", "identifier": "listSongs_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences)", "return": "ArrayList<String>", "signature": "ArrayList<String> listSongs_File(Context c, Preferences preferences)", "testcase": false }, { "class_method_signature": "StorageAccess.getUriForItem(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": " Uri getUriForItem(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "getUriForItem", "modifiers": "", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "Uri", "signature": "Uri getUriForItem(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.getUriForItem_SAF(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "@SuppressLint(\"NewApi\") private Uri getUriForItem_SAF(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "getUriForItem_SAF", "modifiers": "@SuppressLint(\"NewApi\") private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "Uri", "signature": "Uri getUriForItem_SAF(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.getUriForItem_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "private Uri getUriForItem_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "getUriForItem_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "Uri", "signature": "Uri getUriForItem_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.fixFoldersAndFiles(Context c, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "private String[] fixFoldersAndFiles(Context c, String folder, String subfolder, String filename)", "identifier": "fixFoldersAndFiles", "modifiers": "private", "parameters": "(Context c, String folder, String subfolder, String filename)", "return": "String[]", "signature": "String[] fixFoldersAndFiles(Context c, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.createFile(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "@TargetApi(Build.VERSION_CODES.LOLLIPOP) boolean createFile(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "identifier": "createFile", "modifiers": "@TargetApi(Build.VERSION_CODES.LOLLIPOP)", "parameters": "(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "return": "boolean", "signature": "boolean createFile(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.createFile_SAF(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private boolean createFile_SAF(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "identifier": "createFile_SAF", "modifiers": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "return": "boolean", "signature": "boolean createFile_SAF(Context c, Preferences preferences, String mimeType, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.createFile_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "constructor": false, "full_signature": "private boolean createFile_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "identifier": "createFile_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder, String filename)", "return": "boolean", "signature": "boolean createFile_File(Context c, Preferences preferences, String folder, String subfolder, String filename)", "testcase": false }, { "class_method_signature": "StorageAccess.docContractCreate(Context c, Uri uri, String mimeType, String name)", "constructor": false, "full_signature": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private boolean docContractCreate(Context c, Uri uri, String mimeType, String name)", "identifier": "docContractCreate", "modifiers": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Context c, Uri uri, String mimeType, String name)", "return": "boolean", "signature": "boolean docContractCreate(Context c, Uri uri, String mimeType, String name)", "testcase": false }, { "class_method_signature": "StorageAccess.removeStartAndEndSlashes(String s)", "constructor": false, "full_signature": "private String removeStartAndEndSlashes(String s)", "identifier": "removeStartAndEndSlashes", "modifiers": "private", "parameters": "(String s)", "return": "String", "signature": "String removeStartAndEndSlashes(String s)", "testcase": false }, { "class_method_signature": "StorageAccess.getUTFEncoding(Context c, Uri uri)", "constructor": false, "full_signature": " String getUTFEncoding(Context c, Uri uri)", "identifier": "getUTFEncoding", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "String", "signature": "String getUTFEncoding(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.getFileSizeFromUri(Context c, Uri uri)", "constructor": false, "full_signature": " float getFileSizeFromUri(Context c, Uri uri)", "identifier": "getFileSizeFromUri", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "float", "signature": "float getFileSizeFromUri(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.getFileSizeFromUri_SAF(Context c, Uri uri)", "constructor": false, "full_signature": "private float getFileSizeFromUri_SAF(Context c, Uri uri)", "identifier": "getFileSizeFromUri_SAF", "modifiers": "private", "parameters": "(Context c, Uri uri)", "return": "float", "signature": "float getFileSizeFromUri_SAF(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.getFileSizeFromUri_File(Uri uri)", "constructor": false, "full_signature": "private float getFileSizeFromUri_File(Uri uri)", "identifier": "getFileSizeFromUri_File", "modifiers": "private", "parameters": "(Uri uri)", "return": "float", "signature": "float getFileSizeFromUri_File(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.uriExists(Context c, Uri uri)", "constructor": false, "full_signature": " boolean uriExists(Context c, Uri uri)", "identifier": "uriExists", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean uriExists(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.uriExists_SAF(Context c, Uri uri)", "constructor": false, "full_signature": "private boolean uriExists_SAF(Context c, Uri uri)", "identifier": "uriExists_SAF", "modifiers": "private", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean uriExists_SAF(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.uriExists_File(Context c, Uri uri)", "constructor": false, "full_signature": "private boolean uriExists_File(Context c, Uri uri)", "identifier": "uriExists_File", "modifiers": "private", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean uriExists_File(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.uriIsFile(Context c, Uri uri)", "constructor": false, "full_signature": " boolean uriIsFile(Context c, Uri uri)", "identifier": "uriIsFile", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean uriIsFile(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.uriIsFile_SAF(Context c, Uri uri)", "constructor": false, "full_signature": "private boolean uriIsFile_SAF(Context c, Uri uri)", "identifier": "uriIsFile_SAF", "modifiers": "private", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean uriIsFile_SAF(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.uriIsFile_File(Uri uri)", "constructor": false, "full_signature": "private boolean uriIsFile_File(Uri uri)", "identifier": "uriIsFile_File", "modifiers": "private", "parameters": "(Uri uri)", "return": "boolean", "signature": "boolean uriIsFile_File(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.fixLocalisedUri(Context c, Preferences preferences, String uriString)", "constructor": false, "full_signature": " Uri fixLocalisedUri(Context c, Preferences preferences, String uriString)", "identifier": "fixLocalisedUri", "modifiers": "", "parameters": "(Context c, Preferences preferences, String uriString)", "return": "Uri", "signature": "Uri fixLocalisedUri(Context c, Preferences preferences, String uriString)", "testcase": false }, { "class_method_signature": "StorageAccess.fixUriToLocal(Uri uri)", "constructor": false, "full_signature": " String fixUriToLocal(Uri uri)", "identifier": "fixUriToLocal", "modifiers": "", "parameters": "(Uri uri)", "return": "String", "signature": "String fixUriToLocal(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.listFilesInFolder(Context c, Preferences preferences, String folder, String subfolder)", "constructor": false, "full_signature": "@SuppressLint(\"NewApi\") ArrayList<String> listFilesInFolder(Context c, Preferences preferences, String folder, String subfolder)", "identifier": "listFilesInFolder", "modifiers": "@SuppressLint(\"NewApi\")", "parameters": "(Context c, Preferences preferences, String folder, String subfolder)", "return": "ArrayList<String>", "signature": "ArrayList<String> listFilesInFolder(Context c, Preferences preferences, String folder, String subfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.listFilesInFolder_SAF(Context c, Preferences preferences, String folder, String subfolder)", "constructor": false, "full_signature": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private ArrayList<String> listFilesInFolder_SAF(Context c, Preferences preferences, String folder, String subfolder)", "identifier": "listFilesInFolder_SAF", "modifiers": "@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder)", "return": "ArrayList<String>", "signature": "ArrayList<String> listFilesInFolder_SAF(Context c, Preferences preferences, String folder, String subfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.listFilesInFolder_File(Context c, Preferences preferences, String folder, String subfolder)", "constructor": false, "full_signature": "private ArrayList<String> listFilesInFolder_File(Context c, Preferences preferences, String folder, String subfolder)", "identifier": "listFilesInFolder_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String folder, String subfolder)", "return": "ArrayList<String>", "signature": "ArrayList<String> listFilesInFolder_File(Context c, Preferences preferences, String folder, String subfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.extractBibleZipFile(Context c, Preferences preferences, Uri zipUri)", "constructor": false, "full_signature": " void extractBibleZipFile(Context c, Preferences preferences, Uri zipUri)", "identifier": "extractBibleZipFile", "modifiers": "", "parameters": "(Context c, Preferences preferences, Uri zipUri)", "return": "void", "signature": "void extractBibleZipFile(Context c, Preferences preferences, Uri zipUri)", "testcase": false }, { "class_method_signature": "StorageAccess.deleteFile(Context c, Uri uri)", "constructor": false, "full_signature": " boolean deleteFile(Context c, Uri uri)", "identifier": "deleteFile", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean deleteFile(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.deleteFile_SAF(Context c, Uri uri)", "constructor": false, "full_signature": "private boolean deleteFile_SAF(Context c, Uri uri)", "identifier": "deleteFile_SAF", "modifiers": "private", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean deleteFile_SAF(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.deleteFile_File(Uri uri)", "constructor": false, "full_signature": "private boolean deleteFile_File(Uri uri)", "identifier": "deleteFile_File", "modifiers": "private", "parameters": "(Uri uri)", "return": "boolean", "signature": "boolean deleteFile_File(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.renameFolder(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "constructor": false, "full_signature": " boolean renameFolder(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "identifier": "renameFolder", "modifiers": "", "parameters": "(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "return": "boolean", "signature": "boolean renameFolder(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.renameFolder_File(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "constructor": false, "full_signature": "private boolean renameFolder_File(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "identifier": "renameFolder_File", "modifiers": "private", "parameters": "(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "return": "boolean", "signature": "boolean renameFolder_File(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.renameFolder_SAF(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "constructor": false, "full_signature": "@TargetApi(Build.VERSION_CODES.LOLLIPOP) private boolean renameFolder_SAF(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "identifier": "renameFolder_SAF", "modifiers": "@TargetApi(Build.VERSION_CODES.LOLLIPOP) private", "parameters": "(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "return": "boolean", "signature": "boolean renameFolder_SAF(Context c, Preferences preferences, String oldsubfolder, String newsubfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.renameSetFile(Context c, Preferences preferences, String oldname, String newname)", "constructor": false, "full_signature": " boolean renameSetFile(Context c, Preferences preferences, String oldname, String newname)", "identifier": "renameSetFile", "modifiers": "", "parameters": "(Context c, Preferences preferences, String oldname, String newname)", "return": "boolean", "signature": "boolean renameSetFile(Context c, Preferences preferences, String oldname, String newname)", "testcase": false }, { "class_method_signature": "StorageAccess.canWrite(Context c, Uri uri)", "constructor": false, "full_signature": " boolean canWrite(Context c, Uri uri)", "identifier": "canWrite", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean canWrite(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.canWrite_SAF(Context c, Uri uri)", "constructor": false, "full_signature": "private boolean canWrite_SAF(Context c, Uri uri)", "identifier": "canWrite_SAF", "modifiers": "private", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean canWrite_SAF(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.canWrite_File(Uri uri)", "constructor": false, "full_signature": "private boolean canWrite_File(Uri uri)", "identifier": "canWrite_File", "modifiers": "private", "parameters": "(Uri uri)", "return": "boolean", "signature": "boolean canWrite_File(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.wipeFolder(Context c, Preferences preferences, String folder, String subfolder)", "constructor": false, "full_signature": " void wipeFolder(Context c, Preferences preferences, String folder, String subfolder)", "identifier": "wipeFolder", "modifiers": "", "parameters": "(Context c, Preferences preferences, String folder, String subfolder)", "return": "void", "signature": "void wipeFolder(Context c, Preferences preferences, String folder, String subfolder)", "testcase": false }, { "class_method_signature": "StorageAccess.containsXMLTags(Context c, Uri uri)", "constructor": false, "full_signature": " boolean containsXMLTags(Context c, Uri uri)", "identifier": "containsXMLTags", "modifiers": "", "parameters": "(Context c, Uri uri)", "return": "boolean", "signature": "boolean containsXMLTags(Context c, Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.isTextFile(Uri uri)", "constructor": false, "full_signature": " boolean isTextFile(Uri uri)", "identifier": "isTextFile", "modifiers": "", "parameters": "(Uri uri)", "return": "boolean", "signature": "boolean isTextFile(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.getPartOfUri(Uri uri)", "constructor": false, "full_signature": " String getPartOfUri(Uri uri)", "identifier": "getPartOfUri", "modifiers": "", "parameters": "(Uri uri)", "return": "String", "signature": "String getPartOfUri(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.checkFileExtensionValid(Uri uri)", "constructor": false, "full_signature": " boolean checkFileExtensionValid(Uri uri)", "identifier": "checkFileExtensionValid", "modifiers": "", "parameters": "(Uri uri)", "return": "boolean", "signature": "boolean checkFileExtensionValid(Uri uri)", "testcase": false }, { "class_method_signature": "StorageAccess.determineFileTypeByExtension()", "constructor": false, "full_signature": " boolean determineFileTypeByExtension()", "identifier": "determineFileTypeByExtension", "modifiers": "", "parameters": "()", "return": "boolean", "signature": "boolean determineFileTypeByExtension()", "testcase": false }, { "class_method_signature": "StorageAccess.getImageSlide(Context c, String loc)", "constructor": false, "full_signature": " String getImageSlide(Context c, String loc)", "identifier": "getImageSlide", "modifiers": "", "parameters": "(Context c, String loc)", "return": "String", "signature": "String getImageSlide(Context c, String loc)", "testcase": false }, { "class_method_signature": "StorageAccess.songFolderAndFileOnly(Context c, String uriString)", "constructor": false, "full_signature": "private String songFolderAndFileOnly(Context c, String uriString)", "identifier": "songFolderAndFileOnly", "modifiers": "private", "parameters": "(Context c, String uriString)", "return": "String", "signature": "String songFolderAndFileOnly(Context c, String uriString)", "testcase": false }, { "class_method_signature": "StorageAccess.writeSongIDFile(Context c, Preferences preferences, ArrayList<String> songIds)", "constructor": false, "full_signature": " void writeSongIDFile(Context c, Preferences preferences, ArrayList<String> songIds)", "identifier": "writeSongIDFile", "modifiers": "", "parameters": "(Context c, Preferences preferences, ArrayList<String> songIds)", "return": "void", "signature": "void writeSongIDFile(Context c, Preferences preferences, ArrayList<String> songIds)", "testcase": false }, { "class_method_signature": "StorageAccess.updateNonOpenSongDB(Context c, StorageAccess storageAccess, Preferences preferences, String what, String with)", "constructor": false, "full_signature": " void updateNonOpenSongDB(Context c, StorageAccess storageAccess, Preferences preferences, String what, String with)", "identifier": "updateNonOpenSongDB", "modifiers": "", "parameters": "(Context c, StorageAccess storageAccess, Preferences preferences, String what, String with)", "return": "void", "signature": "void updateNonOpenSongDB(Context c, StorageAccess storageAccess, Preferences preferences, String what, String with)", "testcase": false }, { "class_method_signature": "StorageAccess.safeFilename(String filename)", "constructor": false, "full_signature": "public String safeFilename(String filename)", "identifier": "safeFilename", "modifiers": "public", "parameters": "(String filename)", "return": "String", "signature": "String safeFilename(String filename)", "testcase": false } ], "superclass": "" }
{ "body": "public String safeFilename(String filename) {\n // Remove bad characters from filenames\n filename = filename.replaceAll(\"[*?/<>&!#$+\\\"'{}:@\\\\\\\\]\",\"\"); // Removes bad characters\n filename = filename.replaceAll(\"\\\\s{2,}\", \" \"); // Removes double spaces\n return filename.trim(); // Returns the trimmed value\n }", "class_method_signature": "StorageAccess.safeFilename(String filename)", "constructor": false, "full_signature": "public String safeFilename(String filename)", "identifier": "safeFilename", "invocations": [ "replaceAll", "replaceAll", "trim" ], "modifiers": "public", "parameters": "(String filename)", "return": "String", "signature": "String safeFilename(String filename)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 13, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 34568856, "size": 35705, "stargazer_count": 14, "stars": null, "updates": null, "url": "https://github.com/thebigg73/OpenSongTablet" }
153280357_3
{ "fields": [ { "declarator": "tokenStore", "modifier": "private", "original_string": "private MongoTokenStore tokenStore;", "type": "MongoTokenStore", "var_name": "tokenStore" }, { "declarator": "tokenStoreDifferentOwner", "modifier": "private", "original_string": "private MongoTokenStore tokenStoreDifferentOwner;", "type": "MongoTokenStore", "var_name": "tokenStoreDifferentOwner" }, { "declarator": "mongoExe", "modifier": "private static", "original_string": "private static MongodExecutable mongoExe;", "type": "MongodExecutable", "var_name": "mongoExe" }, { "declarator": "mongod", "modifier": "private static", "original_string": "private static MongodProcess mongod;", "type": "MongodProcess", "var_name": "mongod" }, { "declarator": "mongoTemplate", "modifier": "private", "original_string": "private MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "trackingTokensCollection", "modifier": "private", "original_string": "private MongoCollection<Document> trackingTokensCollection;", "type": "MongoCollection<Document>", "var_name": "trackingTokensCollection" }, { "declarator": "serializer", "modifier": "private", "original_string": "private Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout = Duration.ofSeconds(5)", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout = Duration.ofSeconds(5);", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "contentType = byte[].class", "modifier": "private final", "original_string": "private final Class<byte[]> contentType = byte[].class;", "type": "Class<byte[]>", "var_name": "contentType" }, { "declarator": "testProcessorName = \"testProcessorName\"", "modifier": "private final", "original_string": "private final String testProcessorName = \"testProcessorName\";", "type": "String", "var_name": "testProcessorName" }, { "declarator": "testSegment = 9", "modifier": "private final", "original_string": "private final int testSegment = 9;", "type": "int", "var_name": "testSegment" }, { "declarator": "testSegmentCount = 10", "modifier": "private final", "original_string": "private final int testSegmentCount = 10;", "type": "int", "var_name": "testSegmentCount" }, { "declarator": "testOwner = \"testOwner\"", "modifier": "private final", "original_string": "private final String testOwner = \"testOwner\";", "type": "String", "var_name": "testOwner" }, { "declarator": "context", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ApplicationContext context;", "type": "ApplicationContext", "var_name": "context" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStoreTest.java", "identifier": "MongoTokenStoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testInitializeSegmentThrowsUnableToInitializeTokenExceptionForDuplicateKey() {\n GlobalSequenceTrackingToken testToken = new GlobalSequenceTrackingToken(100);\n tokenStore.initializeSegment(testToken, testProcessorName, testSegment);\n // Initializes the given token twice, causing the exception\n assertThrows(\n UnableToInitializeTokenException.class,\n () -> tokenStore.initializeSegment(testToken, testProcessorName, testSegment)\n );\n }", "class_method_signature": "MongoTokenStoreTest.testInitializeSegmentThrowsUnableToInitializeTokenExceptionForDuplicateKey()", "constructor": false, "full_signature": "@Test void testInitializeSegmentThrowsUnableToInitializeTokenExceptionForDuplicateKey()", "identifier": "testInitializeSegmentThrowsUnableToInitializeTokenExceptionForDuplicateKey", "invocations": [ "initializeSegment", "assertThrows", "initializeSegment" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testInitializeSegmentThrowsUnableToInitializeTokenExceptionForDuplicateKey()", "testcase": true }
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MongoTokenStore.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MongoTokenStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "clock = Clock.systemUTC()", "modifier": "private final static", "original_string": "private final static Clock clock = Clock.systemUTC();", "type": "Clock", "var_name": "clock" }, { "declarator": "mongoTemplate", "modifier": "private final", "original_string": "private final MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "serializer", "modifier": "private final", "original_string": "private final Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout;", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "nodeId", "modifier": "private final", "original_string": "private final String nodeId;", "type": "String", "var_name": "nodeId" }, { "declarator": "contentType", "modifier": "private final", "original_string": "private final Class<?> contentType;", "type": "Class<?>", "var_name": "contentType" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStore.java", "identifier": "MongoTokenStore", "interfaces": "implements TokenStore", "methods": [ { "class_method_signature": "MongoTokenStore.MongoTokenStore(Builder builder)", "constructor": true, "full_signature": "protected MongoTokenStore(Builder builder)", "identifier": "MongoTokenStore", "modifiers": "protected", "parameters": "(Builder builder)", "return": "", "signature": " MongoTokenStore(Builder builder)", "testcase": false }, { "class_method_signature": "MongoTokenStore.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "modifiers": "public static", "parameters": "()", "return": "Builder", "signature": "Builder builder()", "testcase": false }, { "class_method_signature": "MongoTokenStore.storeToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "@Override public void storeToken(TrackingToken token, String processorName, int segment)", "identifier": "storeToken", "modifiers": "@Override public", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void storeToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.updateToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "private void updateToken(TrackingToken token, String processorName, int segment)", "identifier": "updateToken", "modifiers": "private", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void updateToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName, int segmentCount)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName, int segmentCount)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName, int segmentCount)", "return": "void", "signature": "void initializeTokenSegments(String processorName, int segmentCount)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "return": "void", "signature": "void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public TrackingToken fetchToken(String processorName, int segment)", "identifier": "fetchToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "TrackingToken", "signature": "TrackingToken fetchToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.loadToken(String processorName, int segment)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> loadToken(String processorName, int segment)", "identifier": "loadToken", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> loadToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.extendClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void extendClaim(String processorName, int segment)", "identifier": "extendClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void extendClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.releaseClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void releaseClaim(String processorName, int segment)", "identifier": "releaseClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void releaseClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "constructor": false, "full_signature": "@Override public void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "identifier": "initializeSegment", "modifiers": "@Override public", "parameters": "(TrackingToken token,\n String processorName,\n int segment)", "return": "void", "signature": "void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.deleteToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void deleteToken(String processorName, int segment)", "identifier": "deleteToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void deleteToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.requiresExplicitSegmentInitialization()", "constructor": false, "full_signature": "@Override public boolean requiresExplicitSegmentInitialization()", "identifier": "requiresExplicitSegmentInitialization", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean requiresExplicitSegmentInitialization()", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchSegments(String processorName)", "constructor": false, "full_signature": "@Override public int[] fetchSegments(String processorName)", "identifier": "fetchSegments", "modifiers": "@Override public", "parameters": "(String processorName)", "return": "int[]", "signature": "int[] fetchSegments(String processorName)", "testcase": false }, { "class_method_signature": "MongoTokenStore.claimableTokenEntryFilter(String processorName, int segment)", "constructor": false, "full_signature": "private Bson claimableTokenEntryFilter(String processorName, int segment)", "identifier": "claimableTokenEntryFilter", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "Bson", "signature": "Bson claimableTokenEntryFilter(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "constructor": false, "full_signature": "private Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "identifier": "tokenEntryToDocument", "modifiers": "private", "parameters": "(AbstractTokenEntry<?> tokenEntry)", "return": "Document", "signature": "Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "testcase": false }, { "class_method_signature": "MongoTokenStore.documentToTokenEntry(Document document)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> documentToTokenEntry(Document document)", "identifier": "documentToTokenEntry", "modifiers": "private", "parameters": "(Document document)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> documentToTokenEntry(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.readSerializedData(Document document)", "constructor": false, "full_signature": "@SuppressWarnings(\"unchecked\") private T readSerializedData(Document document)", "identifier": "readSerializedData", "modifiers": "@SuppressWarnings(\"unchecked\") private", "parameters": "(Document document)", "return": "T", "signature": "T readSerializedData(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.ensureIndexes()", "constructor": false, "full_signature": "@Deprecated public void ensureIndexes()", "identifier": "ensureIndexes", "modifiers": "@Deprecated public", "parameters": "()", "return": "void", "signature": "void ensureIndexes()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public void initializeSegment(TrackingToken token,\n String processorName,\n int segment) throws UnableToInitializeTokenException {\n try {\n AbstractTokenEntry<?> tokenEntry =\n new GenericTokenEntry<>(token, serializer, contentType, processorName, segment);\n\n mongoTemplate.trackingTokensCollection()\n .insertOne(tokenEntryToDocument(tokenEntry));\n } catch (MongoWriteException exception) {\n if (ErrorCategory.fromErrorCode(exception.getError().getCode()) == ErrorCategory.DUPLICATE_KEY) {\n throw new UnableToInitializeTokenException(\n format(\"Unable to initialize token '%s[%s]'\", processorName, segment)\n );\n }\n }\n }", "class_method_signature": "MongoTokenStore.initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "constructor": false, "full_signature": "@Override public void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "identifier": "initializeSegment", "invocations": [ "insertOne", "trackingTokensCollection", "tokenEntryToDocument", "fromErrorCode", "getCode", "getError", "format" ], "modifiers": "@Override public", "parameters": "(TrackingToken token,\n String processorName,\n int segment)", "return": "void", "signature": "void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_2
{ "fields": [ { "declarator": "tokenStore", "modifier": "private", "original_string": "private MongoTokenStore tokenStore;", "type": "MongoTokenStore", "var_name": "tokenStore" }, { "declarator": "tokenStoreDifferentOwner", "modifier": "private", "original_string": "private MongoTokenStore tokenStoreDifferentOwner;", "type": "MongoTokenStore", "var_name": "tokenStoreDifferentOwner" }, { "declarator": "mongoExe", "modifier": "private static", "original_string": "private static MongodExecutable mongoExe;", "type": "MongodExecutable", "var_name": "mongoExe" }, { "declarator": "mongod", "modifier": "private static", "original_string": "private static MongodProcess mongod;", "type": "MongodProcess", "var_name": "mongod" }, { "declarator": "mongoTemplate", "modifier": "private", "original_string": "private MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "trackingTokensCollection", "modifier": "private", "original_string": "private MongoCollection<Document> trackingTokensCollection;", "type": "MongoCollection<Document>", "var_name": "trackingTokensCollection" }, { "declarator": "serializer", "modifier": "private", "original_string": "private Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout = Duration.ofSeconds(5)", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout = Duration.ofSeconds(5);", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "contentType = byte[].class", "modifier": "private final", "original_string": "private final Class<byte[]> contentType = byte[].class;", "type": "Class<byte[]>", "var_name": "contentType" }, { "declarator": "testProcessorName = \"testProcessorName\"", "modifier": "private final", "original_string": "private final String testProcessorName = \"testProcessorName\";", "type": "String", "var_name": "testProcessorName" }, { "declarator": "testSegment = 9", "modifier": "private final", "original_string": "private final int testSegment = 9;", "type": "int", "var_name": "testSegment" }, { "declarator": "testSegmentCount = 10", "modifier": "private final", "original_string": "private final int testSegmentCount = 10;", "type": "int", "var_name": "testSegmentCount" }, { "declarator": "testOwner = \"testOwner\"", "modifier": "private final", "original_string": "private final String testOwner = \"testOwner\";", "type": "String", "var_name": "testOwner" }, { "declarator": "context", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ApplicationContext context;", "type": "ApplicationContext", "var_name": "context" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStoreTest.java", "identifier": "MongoTokenStoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testRequiresExplicitSegmentInitializationReturnsTrue() {\n assertTrue(tokenStore.requiresExplicitSegmentInitialization());\n }", "class_method_signature": "MongoTokenStoreTest.testRequiresExplicitSegmentInitializationReturnsTrue()", "constructor": false, "full_signature": "@Test void testRequiresExplicitSegmentInitializationReturnsTrue()", "identifier": "testRequiresExplicitSegmentInitializationReturnsTrue", "invocations": [ "assertTrue", "requiresExplicitSegmentInitialization" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testRequiresExplicitSegmentInitializationReturnsTrue()", "testcase": true }
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MongoTokenStore.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MongoTokenStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "clock = Clock.systemUTC()", "modifier": "private final static", "original_string": "private final static Clock clock = Clock.systemUTC();", "type": "Clock", "var_name": "clock" }, { "declarator": "mongoTemplate", "modifier": "private final", "original_string": "private final MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "serializer", "modifier": "private final", "original_string": "private final Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout;", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "nodeId", "modifier": "private final", "original_string": "private final String nodeId;", "type": "String", "var_name": "nodeId" }, { "declarator": "contentType", "modifier": "private final", "original_string": "private final Class<?> contentType;", "type": "Class<?>", "var_name": "contentType" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStore.java", "identifier": "MongoTokenStore", "interfaces": "implements TokenStore", "methods": [ { "class_method_signature": "MongoTokenStore.MongoTokenStore(Builder builder)", "constructor": true, "full_signature": "protected MongoTokenStore(Builder builder)", "identifier": "MongoTokenStore", "modifiers": "protected", "parameters": "(Builder builder)", "return": "", "signature": " MongoTokenStore(Builder builder)", "testcase": false }, { "class_method_signature": "MongoTokenStore.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "modifiers": "public static", "parameters": "()", "return": "Builder", "signature": "Builder builder()", "testcase": false }, { "class_method_signature": "MongoTokenStore.storeToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "@Override public void storeToken(TrackingToken token, String processorName, int segment)", "identifier": "storeToken", "modifiers": "@Override public", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void storeToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.updateToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "private void updateToken(TrackingToken token, String processorName, int segment)", "identifier": "updateToken", "modifiers": "private", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void updateToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName, int segmentCount)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName, int segmentCount)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName, int segmentCount)", "return": "void", "signature": "void initializeTokenSegments(String processorName, int segmentCount)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "return": "void", "signature": "void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public TrackingToken fetchToken(String processorName, int segment)", "identifier": "fetchToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "TrackingToken", "signature": "TrackingToken fetchToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.loadToken(String processorName, int segment)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> loadToken(String processorName, int segment)", "identifier": "loadToken", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> loadToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.extendClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void extendClaim(String processorName, int segment)", "identifier": "extendClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void extendClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.releaseClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void releaseClaim(String processorName, int segment)", "identifier": "releaseClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void releaseClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "constructor": false, "full_signature": "@Override public void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "identifier": "initializeSegment", "modifiers": "@Override public", "parameters": "(TrackingToken token,\n String processorName,\n int segment)", "return": "void", "signature": "void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.deleteToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void deleteToken(String processorName, int segment)", "identifier": "deleteToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void deleteToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.requiresExplicitSegmentInitialization()", "constructor": false, "full_signature": "@Override public boolean requiresExplicitSegmentInitialization()", "identifier": "requiresExplicitSegmentInitialization", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean requiresExplicitSegmentInitialization()", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchSegments(String processorName)", "constructor": false, "full_signature": "@Override public int[] fetchSegments(String processorName)", "identifier": "fetchSegments", "modifiers": "@Override public", "parameters": "(String processorName)", "return": "int[]", "signature": "int[] fetchSegments(String processorName)", "testcase": false }, { "class_method_signature": "MongoTokenStore.claimableTokenEntryFilter(String processorName, int segment)", "constructor": false, "full_signature": "private Bson claimableTokenEntryFilter(String processorName, int segment)", "identifier": "claimableTokenEntryFilter", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "Bson", "signature": "Bson claimableTokenEntryFilter(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "constructor": false, "full_signature": "private Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "identifier": "tokenEntryToDocument", "modifiers": "private", "parameters": "(AbstractTokenEntry<?> tokenEntry)", "return": "Document", "signature": "Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "testcase": false }, { "class_method_signature": "MongoTokenStore.documentToTokenEntry(Document document)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> documentToTokenEntry(Document document)", "identifier": "documentToTokenEntry", "modifiers": "private", "parameters": "(Document document)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> documentToTokenEntry(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.readSerializedData(Document document)", "constructor": false, "full_signature": "@SuppressWarnings(\"unchecked\") private T readSerializedData(Document document)", "identifier": "readSerializedData", "modifiers": "@SuppressWarnings(\"unchecked\") private", "parameters": "(Document document)", "return": "T", "signature": "T readSerializedData(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.ensureIndexes()", "constructor": false, "full_signature": "@Deprecated public void ensureIndexes()", "identifier": "ensureIndexes", "modifiers": "@Deprecated public", "parameters": "()", "return": "void", "signature": "void ensureIndexes()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public boolean requiresExplicitSegmentInitialization() {\n return true;\n }", "class_method_signature": "MongoTokenStore.requiresExplicitSegmentInitialization()", "constructor": false, "full_signature": "@Override public boolean requiresExplicitSegmentInitialization()", "identifier": "requiresExplicitSegmentInitialization", "invocations": [], "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean requiresExplicitSegmentInitialization()", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_5
{ "fields": [ { "declarator": "ONE_SECOND = Duration.ofSeconds(1)", "modifier": "private static final", "original_string": "private static final Duration ONE_SECOND = Duration.ofSeconds(1);", "type": "Duration", "var_name": "ONE_SECOND" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoTrackingTokenTest.java", "identifier": "MongoTrackingTokenTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testUpperBound() {\n MongoTrackingToken first = MongoTrackingToken.of(time(1000), \"0\")\n .advanceTo(time(1001), \"1\", Duration.ofHours(1))\n .advanceTo(time(1002), \"2\", Duration.ofHours(1));\n\n MongoTrackingToken second = MongoTrackingToken.of(time(1003), \"3\");\n\n assertEquals(first.advanceTo(time(1003), \"3\", Duration.ofHours(1)),\n first.upperBound(second));\n }", "class_method_signature": "MongoTrackingTokenTest.testUpperBound()", "constructor": false, "full_signature": "@Test void testUpperBound()", "identifier": "testUpperBound", "invocations": [ "advanceTo", "advanceTo", "of", "time", "time", "ofHours", "time", "ofHours", "of", "time", "assertEquals", "advanceTo", "time", "ofHours", "upperBound" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testUpperBound()", "testcase": true }
{ "fields": [ { "declarator": "timestamp", "modifier": "private final", "original_string": "private final long timestamp;", "type": "long", "var_name": "timestamp" }, { "declarator": "trackedEvents", "modifier": "private final", "original_string": "private final Map<String, Long> trackedEvents;", "type": "Map<String, Long>", "var_name": "trackedEvents" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoTrackingToken.java", "identifier": "MongoTrackingToken", "interfaces": "implements TrackingToken, Serializable", "methods": [ { "class_method_signature": "MongoTrackingToken.MongoTrackingToken(long timestamp, Map<String, Long> trackedEvents)", "constructor": true, "full_signature": "protected MongoTrackingToken(long timestamp, Map<String, Long> trackedEvents)", "identifier": "MongoTrackingToken", "modifiers": "protected", "parameters": "(long timestamp, Map<String, Long> trackedEvents)", "return": "", "signature": " MongoTrackingToken(long timestamp, Map<String, Long> trackedEvents)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.of(Instant timestamp, String eventIdentifier)", "constructor": false, "full_signature": "public static MongoTrackingToken of(Instant timestamp, String eventIdentifier)", "identifier": "of", "modifiers": "public static", "parameters": "(Instant timestamp, String eventIdentifier)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken of(Instant timestamp, String eventIdentifier)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.of(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "constructor": false, "full_signature": "@JsonCreator public static MongoTrackingToken of(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "identifier": "of", "modifiers": "@JsonCreator public static", "parameters": "(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken of(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.advanceTo(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "constructor": false, "full_signature": "public MongoTrackingToken advanceTo(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "identifier": "advanceTo", "modifiers": "public", "parameters": "(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken advanceTo(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.trim(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "constructor": false, "full_signature": "private Map<String, Long> trim(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "identifier": "trim", "modifiers": "private", "parameters": "(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "return": "Map<String, Long>", "signature": "Map<String, Long> trim(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.getTimestamp()", "constructor": false, "full_signature": "public Instant getTimestamp()", "identifier": "getTimestamp", "modifiers": "public", "parameters": "()", "return": "Instant", "signature": "Instant getTimestamp()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.getTrackedEvents()", "constructor": false, "full_signature": "public Map<String, Long> getTrackedEvents()", "identifier": "getTrackedEvents", "modifiers": "public", "parameters": "()", "return": "Map<String, Long>", "signature": "Map<String, Long> getTrackedEvents()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.getKnownEventIds()", "constructor": false, "full_signature": "@JsonIgnore public Set<String> getKnownEventIds()", "identifier": "getKnownEventIds", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "Set<String>", "signature": "Set<String> getKnownEventIds()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.equals(Object o)", "constructor": false, "full_signature": "@Override public boolean equals(Object o)", "identifier": "equals", "modifiers": "@Override public", "parameters": "(Object o)", "return": "boolean", "signature": "boolean equals(Object o)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "modifiers": "@Override public", "parameters": "()", "return": "int", "signature": "int hashCode()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toString()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.lowerBound(TrackingToken other)", "constructor": false, "full_signature": "@Override public TrackingToken lowerBound(TrackingToken other)", "identifier": "lowerBound", "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "TrackingToken", "signature": "TrackingToken lowerBound(TrackingToken other)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.upperBound(TrackingToken other)", "constructor": false, "full_signature": "@Override public TrackingToken upperBound(TrackingToken other)", "identifier": "upperBound", "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "TrackingToken", "signature": "TrackingToken upperBound(TrackingToken other)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.covers(TrackingToken other)", "constructor": false, "full_signature": "@Override public boolean covers(TrackingToken other)", "identifier": "covers", "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "boolean", "signature": "boolean covers(TrackingToken other)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public TrackingToken upperBound(TrackingToken other) {\n Assert.isTrue(other instanceof MongoTrackingToken, () -> \"Incompatible token type provided.\");\n //noinspection ConstantConditions\n long timestamp = max(((MongoTrackingToken) other).timestamp, this.timestamp);\n Map<String, Long> events = new HashMap<>(trackedEvents);\n //noinspection ConstantConditions\n events.putAll(((MongoTrackingToken) other).trackedEvents);\n return new MongoTrackingToken(timestamp, events);\n }", "class_method_signature": "MongoTrackingToken.upperBound(TrackingToken other)", "constructor": false, "full_signature": "@Override public TrackingToken upperBound(TrackingToken other)", "identifier": "upperBound", "invocations": [ "isTrue", "max", "putAll" ], "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "TrackingToken", "signature": "TrackingToken upperBound(TrackingToken other)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_8
{ "fields": [ { "declarator": "mongod", "modifier": "private static", "original_string": "private static MongodProcess mongod;", "type": "MongodProcess", "var_name": "mongod" }, { "declarator": "mongoExe", "modifier": "private static", "original_string": "private static MongodExecutable mongoExe;", "type": "MongodExecutable", "var_name": "mongoExe" }, { "declarator": "sagaStore", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private MongoSagaStore sagaStore;", "type": "MongoSagaStore", "var_name": "sagaStore" }, { "declarator": "mongoTemplate", "modifier": "@Autowired\n @Qualifier(\"sagaMongoTemplate\")\n private", "original_string": "@Autowired\n @Qualifier(\"sagaMongoTemplate\")\n private MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "context", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ApplicationContext context;", "type": "ApplicationContext", "var_name": "context" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventhandling/saga/repository/MongoSagaStoreTest.java", "identifier": "MongoSagaStoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testLoadSaga_NotFound() {\n assertNull(sagaStore.loadSaga(MyTestSaga.class, \"123456\"));\n }", "class_method_signature": "MongoSagaStoreTest.testLoadSaga_NotFound()", "constructor": false, "full_signature": "@Test void testLoadSaga_NotFound()", "identifier": "testLoadSaga_NotFound", "invocations": [ "assertNull", "loadSaga" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testLoadSaga_NotFound()", "testcase": true }
{ "fields": [ { "declarator": "mongoTemplate", "modifier": "private final", "original_string": "private final MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "serializer", "modifier": "private final", "original_string": "private final Serializer serializer;", "type": "Serializer", "var_name": "serializer" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventhandling/saga/repository/MongoSagaStore.java", "identifier": "MongoSagaStore", "interfaces": "implements SagaStore<Object>", "methods": [ { "class_method_signature": "MongoSagaStore.MongoSagaStore(Builder builder)", "constructor": true, "full_signature": "protected MongoSagaStore(Builder builder)", "identifier": "MongoSagaStore", "modifiers": "protected", "parameters": "(Builder builder)", "return": "", "signature": " MongoSagaStore(Builder builder)", "testcase": false }, { "class_method_signature": "MongoSagaStore.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "modifiers": "public static", "parameters": "()", "return": "Builder", "signature": "Builder builder()", "testcase": false }, { "class_method_signature": "MongoSagaStore.loadSaga(Class<S> sagaType, String sagaIdentifier)", "constructor": false, "full_signature": "@Override public Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier)", "identifier": "loadSaga", "modifiers": "@Override public", "parameters": "(Class<S> sagaType, String sagaIdentifier)", "return": "Entry<S>", "signature": "Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier)", "testcase": false }, { "class_method_signature": "MongoSagaStore.findSagas(Class<?> sagaType, AssociationValue associationValue)", "constructor": false, "full_signature": "@Override public Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue)", "identifier": "findSagas", "modifiers": "@Override public", "parameters": "(Class<?> sagaType, AssociationValue associationValue)", "return": "Set<String>", "signature": "Set<String> findSagas(Class<?> sagaType, AssociationValue associationValue)", "testcase": false }, { "class_method_signature": "MongoSagaStore.associationValueQuery(Class<?> sagaType, AssociationValue associationValue)", "constructor": false, "full_signature": "private BasicDBObject associationValueQuery(Class<?> sagaType, AssociationValue associationValue)", "identifier": "associationValueQuery", "modifiers": "private", "parameters": "(Class<?> sagaType, AssociationValue associationValue)", "return": "BasicDBObject", "signature": "BasicDBObject associationValueQuery(Class<?> sagaType, AssociationValue associationValue)", "testcase": false }, { "class_method_signature": "MongoSagaStore.deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues)", "constructor": false, "full_signature": "@Override public void deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues)", "identifier": "deleteSaga", "modifiers": "@Override public", "parameters": "(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues)", "return": "void", "signature": "void deleteSaga(Class<?> sagaType, String sagaIdentifier, Set<AssociationValue> associationValues)", "testcase": false }, { "class_method_signature": "MongoSagaStore.updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues)", "constructor": false, "full_signature": "@Override public void updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues)", "identifier": "updateSaga", "modifiers": "@Override public", "parameters": "(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues)", "return": "void", "signature": "void updateSaga(Class<?> sagaType, String sagaIdentifier, Object saga, AssociationValues associationValues)", "testcase": false }, { "class_method_signature": "MongoSagaStore.insertSaga(Class<?> sagaType,\n String sagaIdentifier,\n Object saga,\n Set<AssociationValue> associationValues)", "constructor": false, "full_signature": "@Override public void insertSaga(Class<?> sagaType,\n String sagaIdentifier,\n Object saga,\n Set<AssociationValue> associationValues)", "identifier": "insertSaga", "modifiers": "@Override public", "parameters": "(Class<?> sagaType,\n String sagaIdentifier,\n Object saga,\n Set<AssociationValue> associationValues)", "return": "void", "signature": "void insertSaga(Class<?> sagaType,\n String sagaIdentifier,\n Object saga,\n Set<AssociationValue> associationValues)", "testcase": false }, { "class_method_signature": "MongoSagaStore.getSagaTypeName(Class<?> sagaType)", "constructor": false, "full_signature": "private String getSagaTypeName(Class<?> sagaType)", "identifier": "getSagaTypeName", "modifiers": "private", "parameters": "(Class<?> sagaType)", "return": "String", "signature": "String getSagaTypeName(Class<?> sagaType)", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public <S> Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier) {\n Document dbSaga = mongoTemplate.sagaCollection().find(SagaEntry.queryByIdentifier(sagaIdentifier)).first();\n if (dbSaga == null) {\n return null;\n }\n SagaEntry<S> sagaEntry = new SagaEntry<>(dbSaga);\n S loadedSaga = sagaEntry.getSaga(serializer);\n return new Entry<S>() {\n @Override\n public Set<AssociationValue> associationValues() {\n return sagaEntry.getAssociationValues();\n }\n\n @Override\n public S saga() {\n return loadedSaga;\n }\n };\n }", "class_method_signature": "MongoSagaStore.loadSaga(Class<S> sagaType, String sagaIdentifier)", "constructor": false, "full_signature": "@Override public Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier)", "identifier": "loadSaga", "invocations": [ "first", "find", "sagaCollection", "queryByIdentifier", "getSaga", "getAssociationValues" ], "modifiers": "@Override public", "parameters": "(Class<S> sagaType, String sagaIdentifier)", "return": "Entry<S>", "signature": "Entry<S> loadSaga(Class<S> sagaType, String sagaIdentifier)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_4
{ "fields": [], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoFactoryTest.java", "identifier": "MongoFactoryTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void createMongoInstance() {\n MongoFactory mongoFactory = new MongoFactory();\n MongoClient mongoInstance = mongoFactory.createMongo();\n\n assertNotNull(mongoInstance);\n }", "class_method_signature": "MongoFactoryTest.createMongoInstance()", "constructor": false, "full_signature": "@Test void createMongoInstance()", "identifier": "createMongoInstance", "invocations": [ "createMongo", "assertNotNull" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void createMongoInstance()", "testcase": true }
{ "fields": [ { "declarator": "mongoClientSettings = MongoClientSettings.builder().build()", "modifier": "private", "original_string": "private MongoClientSettings mongoClientSettings = MongoClientSettings.builder().build();", "type": "MongoClientSettings", "var_name": "mongoClientSettings" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoFactory.java", "identifier": "MongoFactory", "interfaces": "", "methods": [ { "class_method_signature": "MongoFactory.createMongo()", "constructor": false, "full_signature": "public MongoClient createMongo()", "identifier": "createMongo", "modifiers": "public", "parameters": "()", "return": "MongoClient", "signature": "MongoClient createMongo()", "testcase": false }, { "class_method_signature": "MongoFactory.setMongoClientSettings(MongoClientSettings mongoClientSettings)", "constructor": false, "full_signature": "public void setMongoClientSettings(MongoClientSettings mongoClientSettings)", "identifier": "setMongoClientSettings", "modifiers": "public", "parameters": "(MongoClientSettings mongoClientSettings)", "return": "void", "signature": "void setMongoClientSettings(MongoClientSettings mongoClientSettings)", "testcase": false } ], "superclass": "" }
{ "body": "public MongoClient createMongo() {\n return MongoClients.create(mongoClientSettings);\n }", "class_method_signature": "MongoFactory.createMongo()", "constructor": false, "full_signature": "public MongoClient createMongo()", "identifier": "createMongo", "invocations": [ "create" ], "modifiers": "public", "parameters": "()", "return": "MongoClient", "signature": "MongoClient createMongo()", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_7
{ "fields": [ { "declarator": "mongoExe", "modifier": "private static", "original_string": "private static MongodExecutable mongoExe;", "type": "MongodExecutable", "var_name": "mongoExe" }, { "declarator": "mongod", "modifier": "private static", "original_string": "private static MongodProcess mongod;", "type": "MongodProcess", "var_name": "mongod" }, { "declarator": "context", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ApplicationContext context;", "type": "ApplicationContext", "var_name": "context" }, { "declarator": "mongoTemplate", "modifier": "private", "original_string": "private DefaultMongoTemplate mongoTemplate;", "type": "DefaultMongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "testSubject", "modifier": "private", "original_string": "private MongoEventStorageEngine testSubject;", "type": "MongoEventStorageEngine", "var_name": "testSubject" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoEventStorageEngineTest.java", "identifier": "MongoEventStorageEngineTest", "interfaces": "", "superclass": "extends AbstractMongoEventStorageEngineTest" }
{ "body": "@Test\n void testOnlySingleSnapshotRemains() {\n testSubject.storeSnapshot(createEvent(0));\n testSubject.storeSnapshot(createEvent(1));\n testSubject.storeSnapshot(createEvent(2));\n\n assertEquals(1, mongoTemplate.snapshotCollection().countDocuments());\n }", "class_method_signature": "MongoEventStorageEngineTest.testOnlySingleSnapshotRemains()", "constructor": false, "full_signature": "@Test void testOnlySingleSnapshotRemains()", "identifier": "testOnlySingleSnapshotRemains", "invocations": [ "storeSnapshot", "createEvent", "storeSnapshot", "createEvent", "storeSnapshot", "createEvent", "assertEquals", "countDocuments", "snapshotCollection" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testOnlySingleSnapshotRemains()", "testcase": true }
{ "fields": [ { "declarator": "template", "modifier": "private final", "original_string": "private final MongoTemplate template;", "type": "MongoTemplate", "var_name": "template" }, { "declarator": "storageStrategy", "modifier": "private final", "original_string": "private final StorageStrategy storageStrategy;", "type": "StorageStrategy", "var_name": "storageStrategy" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoEventStorageEngine.java", "identifier": "MongoEventStorageEngine", "interfaces": "", "methods": [ { "class_method_signature": "MongoEventStorageEngine.MongoEventStorageEngine(Builder builder)", "constructor": true, "full_signature": "protected MongoEventStorageEngine(Builder builder)", "identifier": "MongoEventStorageEngine", "modifiers": "protected", "parameters": "(Builder builder)", "return": "", "signature": " MongoEventStorageEngine(Builder builder)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "modifiers": "public static", "parameters": "()", "return": "Builder", "signature": "Builder builder()", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.isDuplicateKeyException(Exception exception)", "constructor": false, "full_signature": "private static boolean isDuplicateKeyException(Exception exception)", "identifier": "isDuplicateKeyException", "modifiers": "private static", "parameters": "(Exception exception)", "return": "boolean", "signature": "boolean isDuplicateKeyException(Exception exception)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.ensureIndexes()", "constructor": false, "full_signature": "@Deprecated public void ensureIndexes()", "identifier": "ensureIndexes", "modifiers": "@Deprecated public", "parameters": "()", "return": "void", "signature": "void ensureIndexes()", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.appendEvents(List<? extends EventMessage<?>> events, Serializer serializer)", "constructor": false, "full_signature": "@Override protected void appendEvents(List<? extends EventMessage<?>> events, Serializer serializer)", "identifier": "appendEvents", "modifiers": "@Override protected", "parameters": "(List<? extends EventMessage<?>> events, Serializer serializer)", "return": "void", "signature": "void appendEvents(List<? extends EventMessage<?>> events, Serializer serializer)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer)", "constructor": false, "full_signature": "@Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer)", "identifier": "storeSnapshot", "modifiers": "@Override protected", "parameters": "(DomainEventMessage<?> snapshot, Serializer serializer)", "return": "void", "signature": "void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.readSnapshotData(String aggregateIdentifier)", "constructor": false, "full_signature": "@Override protected Stream<? extends DomainEventData<?>> readSnapshotData(String aggregateIdentifier)", "identifier": "readSnapshotData", "modifiers": "@Override protected", "parameters": "(String aggregateIdentifier)", "return": "Stream<? extends DomainEventData<?>>", "signature": "Stream<? extends DomainEventData<?>> readSnapshotData(String aggregateIdentifier)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.fetchDomainEvents(String aggregateIdentifier, long firstSequenceNumber,\n int batchSize)", "constructor": false, "full_signature": "@Override protected List<? extends DomainEventData<?>> fetchDomainEvents(String aggregateIdentifier, long firstSequenceNumber,\n int batchSize)", "identifier": "fetchDomainEvents", "modifiers": "@Override protected", "parameters": "(String aggregateIdentifier, long firstSequenceNumber,\n int batchSize)", "return": "List<? extends DomainEventData<?>>", "signature": "List<? extends DomainEventData<?>> fetchDomainEvents(String aggregateIdentifier, long firstSequenceNumber,\n int batchSize)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.fetchTrackedEvents(TrackingToken lastToken, int batchSize)", "constructor": false, "full_signature": "@Override protected List<? extends TrackedEventData<?>> fetchTrackedEvents(TrackingToken lastToken, int batchSize)", "identifier": "fetchTrackedEvents", "modifiers": "@Override protected", "parameters": "(TrackingToken lastToken, int batchSize)", "return": "List<? extends TrackedEventData<?>>", "signature": "List<? extends TrackedEventData<?>> fetchTrackedEvents(TrackingToken lastToken, int batchSize)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.lastSequenceNumberFor(String aggregateIdentifier)", "constructor": false, "full_signature": "@Override public Optional<Long> lastSequenceNumberFor(String aggregateIdentifier)", "identifier": "lastSequenceNumberFor", "modifiers": "@Override public", "parameters": "(String aggregateIdentifier)", "return": "Optional<Long>", "signature": "Optional<Long> lastSequenceNumberFor(String aggregateIdentifier)", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.createTailToken()", "constructor": false, "full_signature": "@Override public TrackingToken createTailToken()", "identifier": "createTailToken", "modifiers": "@Override public", "parameters": "()", "return": "TrackingToken", "signature": "TrackingToken createTailToken()", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.createHeadToken()", "constructor": false, "full_signature": "@Override public TrackingToken createHeadToken()", "identifier": "createHeadToken", "modifiers": "@Override public", "parameters": "()", "return": "TrackingToken", "signature": "TrackingToken createHeadToken()", "testcase": false }, { "class_method_signature": "MongoEventStorageEngine.createTokenAt(Instant dateTime)", "constructor": false, "full_signature": "@Override public TrackingToken createTokenAt(Instant dateTime)", "identifier": "createTokenAt", "modifiers": "@Override public", "parameters": "(Instant dateTime)", "return": "TrackingToken", "signature": "TrackingToken createTokenAt(Instant dateTime)", "testcase": false } ], "superclass": "extends BatchingEventStorageEngine" }
{ "body": "@Override\n protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer) {\n try {\n storageStrategy.appendSnapshot(template.snapshotCollection(), snapshot, serializer);\n storageStrategy.deleteSnapshots(\n template.snapshotCollection(), snapshot.getAggregateIdentifier(), snapshot.getSequenceNumber()\n );\n } catch (Exception e) {\n handlePersistenceException(e, snapshot);\n }\n }", "class_method_signature": "MongoEventStorageEngine.storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer)", "constructor": false, "full_signature": "@Override protected void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer)", "identifier": "storeSnapshot", "invocations": [ "appendSnapshot", "snapshotCollection", "deleteSnapshots", "snapshotCollection", "getAggregateIdentifier", "getSequenceNumber", "handlePersistenceException" ], "modifiers": "@Override protected", "parameters": "(DomainEventMessage<?> snapshot, Serializer serializer)", "return": "void", "signature": "void storeSnapshot(DomainEventMessage<?> snapshot, Serializer serializer)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_6
{ "fields": [ { "declarator": "ONE_SECOND = Duration.ofSeconds(1)", "modifier": "private static final", "original_string": "private static final Duration ONE_SECOND = Duration.ofSeconds(1);", "type": "Duration", "var_name": "ONE_SECOND" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoTrackingTokenTest.java", "identifier": "MongoTrackingTokenTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testSerializationDeserialization() throws IOException {\n ObjectMapper objectMapper = new ObjectMapper();\n objectMapper.registerModule(new JavaTimeModule());\n MongoTrackingToken mongoTrackingToken = MongoTrackingToken.of(time(1000), \"0\");\n String serialized = objectMapper.writeValueAsString(mongoTrackingToken);\n MongoTrackingToken deserialized = objectMapper.readValue(serialized, MongoTrackingToken.class);\n assertEquals(mongoTrackingToken, deserialized);\n }", "class_method_signature": "MongoTrackingTokenTest.testSerializationDeserialization()", "constructor": false, "full_signature": "@Test void testSerializationDeserialization()", "identifier": "testSerializationDeserialization", "invocations": [ "registerModule", "of", "time", "writeValueAsString", "readValue", "assertEquals" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testSerializationDeserialization()", "testcase": true }
{ "fields": [ { "declarator": "timestamp", "modifier": "private final", "original_string": "private final long timestamp;", "type": "long", "var_name": "timestamp" }, { "declarator": "trackedEvents", "modifier": "private final", "original_string": "private final Map<String, Long> trackedEvents;", "type": "Map<String, Long>", "var_name": "trackedEvents" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/eventstore/MongoTrackingToken.java", "identifier": "MongoTrackingToken", "interfaces": "implements TrackingToken, Serializable", "methods": [ { "class_method_signature": "MongoTrackingToken.MongoTrackingToken(long timestamp, Map<String, Long> trackedEvents)", "constructor": true, "full_signature": "protected MongoTrackingToken(long timestamp, Map<String, Long> trackedEvents)", "identifier": "MongoTrackingToken", "modifiers": "protected", "parameters": "(long timestamp, Map<String, Long> trackedEvents)", "return": "", "signature": " MongoTrackingToken(long timestamp, Map<String, Long> trackedEvents)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.of(Instant timestamp, String eventIdentifier)", "constructor": false, "full_signature": "public static MongoTrackingToken of(Instant timestamp, String eventIdentifier)", "identifier": "of", "modifiers": "public static", "parameters": "(Instant timestamp, String eventIdentifier)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken of(Instant timestamp, String eventIdentifier)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.of(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "constructor": false, "full_signature": "@JsonCreator public static MongoTrackingToken of(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "identifier": "of", "modifiers": "@JsonCreator public static", "parameters": "(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken of(@JsonProperty(\"timestamp\") Instant timestamp,\n @JsonProperty(\"trackedEvents\") Map<String, Long> trackedEvents)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.advanceTo(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "constructor": false, "full_signature": "public MongoTrackingToken advanceTo(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "identifier": "advanceTo", "modifiers": "public", "parameters": "(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken advanceTo(Instant timestamp, String eventIdentifier, Duration lookBackTime)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.trim(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "constructor": false, "full_signature": "private Map<String, Long> trim(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "identifier": "trim", "modifiers": "private", "parameters": "(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "return": "Map<String, Long>", "signature": "Map<String, Long> trim(LinkedHashMap<String, Long> priorEvents, long currentTime, Duration lookBackTime)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.getTimestamp()", "constructor": false, "full_signature": "public Instant getTimestamp()", "identifier": "getTimestamp", "modifiers": "public", "parameters": "()", "return": "Instant", "signature": "Instant getTimestamp()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.getTrackedEvents()", "constructor": false, "full_signature": "public Map<String, Long> getTrackedEvents()", "identifier": "getTrackedEvents", "modifiers": "public", "parameters": "()", "return": "Map<String, Long>", "signature": "Map<String, Long> getTrackedEvents()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.getKnownEventIds()", "constructor": false, "full_signature": "@JsonIgnore public Set<String> getKnownEventIds()", "identifier": "getKnownEventIds", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "Set<String>", "signature": "Set<String> getKnownEventIds()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.equals(Object o)", "constructor": false, "full_signature": "@Override public boolean equals(Object o)", "identifier": "equals", "modifiers": "@Override public", "parameters": "(Object o)", "return": "boolean", "signature": "boolean equals(Object o)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.hashCode()", "constructor": false, "full_signature": "@Override public int hashCode()", "identifier": "hashCode", "modifiers": "@Override public", "parameters": "()", "return": "int", "signature": "int hashCode()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toString()", "testcase": false }, { "class_method_signature": "MongoTrackingToken.lowerBound(TrackingToken other)", "constructor": false, "full_signature": "@Override public TrackingToken lowerBound(TrackingToken other)", "identifier": "lowerBound", "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "TrackingToken", "signature": "TrackingToken lowerBound(TrackingToken other)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.upperBound(TrackingToken other)", "constructor": false, "full_signature": "@Override public TrackingToken upperBound(TrackingToken other)", "identifier": "upperBound", "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "TrackingToken", "signature": "TrackingToken upperBound(TrackingToken other)", "testcase": false }, { "class_method_signature": "MongoTrackingToken.covers(TrackingToken other)", "constructor": false, "full_signature": "@Override public boolean covers(TrackingToken other)", "identifier": "covers", "modifiers": "@Override public", "parameters": "(TrackingToken other)", "return": "boolean", "signature": "boolean covers(TrackingToken other)", "testcase": false } ], "superclass": "" }
{ "body": "public static MongoTrackingToken of(Instant timestamp, String eventIdentifier) {\n return new MongoTrackingToken(timestamp.toEpochMilli(),\n Collections.singletonMap(eventIdentifier, timestamp.toEpochMilli()));\n }", "class_method_signature": "MongoTrackingToken.of(Instant timestamp, String eventIdentifier)", "constructor": false, "full_signature": "public static MongoTrackingToken of(Instant timestamp, String eventIdentifier)", "identifier": "of", "invocations": [ "toEpochMilli", "singletonMap", "toEpochMilli" ], "modifiers": "public static", "parameters": "(Instant timestamp, String eventIdentifier)", "return": "MongoTrackingToken", "signature": "MongoTrackingToken of(Instant timestamp, String eventIdentifier)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_1
{ "fields": [ { "declarator": "tokenStore", "modifier": "private", "original_string": "private MongoTokenStore tokenStore;", "type": "MongoTokenStore", "var_name": "tokenStore" }, { "declarator": "tokenStoreDifferentOwner", "modifier": "private", "original_string": "private MongoTokenStore tokenStoreDifferentOwner;", "type": "MongoTokenStore", "var_name": "tokenStoreDifferentOwner" }, { "declarator": "mongoExe", "modifier": "private static", "original_string": "private static MongodExecutable mongoExe;", "type": "MongodExecutable", "var_name": "mongoExe" }, { "declarator": "mongod", "modifier": "private static", "original_string": "private static MongodProcess mongod;", "type": "MongodProcess", "var_name": "mongod" }, { "declarator": "mongoTemplate", "modifier": "private", "original_string": "private MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "trackingTokensCollection", "modifier": "private", "original_string": "private MongoCollection<Document> trackingTokensCollection;", "type": "MongoCollection<Document>", "var_name": "trackingTokensCollection" }, { "declarator": "serializer", "modifier": "private", "original_string": "private Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout = Duration.ofSeconds(5)", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout = Duration.ofSeconds(5);", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "contentType = byte[].class", "modifier": "private final", "original_string": "private final Class<byte[]> contentType = byte[].class;", "type": "Class<byte[]>", "var_name": "contentType" }, { "declarator": "testProcessorName = \"testProcessorName\"", "modifier": "private final", "original_string": "private final String testProcessorName = \"testProcessorName\";", "type": "String", "var_name": "testProcessorName" }, { "declarator": "testSegment = 9", "modifier": "private final", "original_string": "private final int testSegment = 9;", "type": "int", "var_name": "testSegment" }, { "declarator": "testSegmentCount = 10", "modifier": "private final", "original_string": "private final int testSegmentCount = 10;", "type": "int", "var_name": "testSegmentCount" }, { "declarator": "testOwner = \"testOwner\"", "modifier": "private final", "original_string": "private final String testOwner = \"testOwner\";", "type": "String", "var_name": "testOwner" }, { "declarator": "context", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ApplicationContext context;", "type": "ApplicationContext", "var_name": "context" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStoreTest.java", "identifier": "MongoTokenStoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testFetchSegments() {\n tokenStore.initializeTokenSegments(\"processor1\", 3);\n tokenStore.initializeTokenSegments(\"processor2\", 1);\n\n assertArrayEquals(new int[]{0, 1, 2}, tokenStore.fetchSegments(\"processor1\"));\n assertArrayEquals(new int[]{0}, tokenStore.fetchSegments(\"processor2\"));\n assertArrayEquals(new int[0], tokenStore.fetchSegments(\"processor3\"));\n }", "class_method_signature": "MongoTokenStoreTest.testFetchSegments()", "constructor": false, "full_signature": "@Test void testFetchSegments()", "identifier": "testFetchSegments", "invocations": [ "initializeTokenSegments", "initializeTokenSegments", "assertArrayEquals", "fetchSegments", "assertArrayEquals", "fetchSegments", "assertArrayEquals", "fetchSegments" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testFetchSegments()", "testcase": true }
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MongoTokenStore.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MongoTokenStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "clock = Clock.systemUTC()", "modifier": "private final static", "original_string": "private final static Clock clock = Clock.systemUTC();", "type": "Clock", "var_name": "clock" }, { "declarator": "mongoTemplate", "modifier": "private final", "original_string": "private final MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "serializer", "modifier": "private final", "original_string": "private final Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout;", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "nodeId", "modifier": "private final", "original_string": "private final String nodeId;", "type": "String", "var_name": "nodeId" }, { "declarator": "contentType", "modifier": "private final", "original_string": "private final Class<?> contentType;", "type": "Class<?>", "var_name": "contentType" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStore.java", "identifier": "MongoTokenStore", "interfaces": "implements TokenStore", "methods": [ { "class_method_signature": "MongoTokenStore.MongoTokenStore(Builder builder)", "constructor": true, "full_signature": "protected MongoTokenStore(Builder builder)", "identifier": "MongoTokenStore", "modifiers": "protected", "parameters": "(Builder builder)", "return": "", "signature": " MongoTokenStore(Builder builder)", "testcase": false }, { "class_method_signature": "MongoTokenStore.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "modifiers": "public static", "parameters": "()", "return": "Builder", "signature": "Builder builder()", "testcase": false }, { "class_method_signature": "MongoTokenStore.storeToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "@Override public void storeToken(TrackingToken token, String processorName, int segment)", "identifier": "storeToken", "modifiers": "@Override public", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void storeToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.updateToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "private void updateToken(TrackingToken token, String processorName, int segment)", "identifier": "updateToken", "modifiers": "private", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void updateToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName, int segmentCount)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName, int segmentCount)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName, int segmentCount)", "return": "void", "signature": "void initializeTokenSegments(String processorName, int segmentCount)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "return": "void", "signature": "void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public TrackingToken fetchToken(String processorName, int segment)", "identifier": "fetchToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "TrackingToken", "signature": "TrackingToken fetchToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.loadToken(String processorName, int segment)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> loadToken(String processorName, int segment)", "identifier": "loadToken", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> loadToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.extendClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void extendClaim(String processorName, int segment)", "identifier": "extendClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void extendClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.releaseClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void releaseClaim(String processorName, int segment)", "identifier": "releaseClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void releaseClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "constructor": false, "full_signature": "@Override public void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "identifier": "initializeSegment", "modifiers": "@Override public", "parameters": "(TrackingToken token,\n String processorName,\n int segment)", "return": "void", "signature": "void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.deleteToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void deleteToken(String processorName, int segment)", "identifier": "deleteToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void deleteToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.requiresExplicitSegmentInitialization()", "constructor": false, "full_signature": "@Override public boolean requiresExplicitSegmentInitialization()", "identifier": "requiresExplicitSegmentInitialization", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean requiresExplicitSegmentInitialization()", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchSegments(String processorName)", "constructor": false, "full_signature": "@Override public int[] fetchSegments(String processorName)", "identifier": "fetchSegments", "modifiers": "@Override public", "parameters": "(String processorName)", "return": "int[]", "signature": "int[] fetchSegments(String processorName)", "testcase": false }, { "class_method_signature": "MongoTokenStore.claimableTokenEntryFilter(String processorName, int segment)", "constructor": false, "full_signature": "private Bson claimableTokenEntryFilter(String processorName, int segment)", "identifier": "claimableTokenEntryFilter", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "Bson", "signature": "Bson claimableTokenEntryFilter(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "constructor": false, "full_signature": "private Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "identifier": "tokenEntryToDocument", "modifiers": "private", "parameters": "(AbstractTokenEntry<?> tokenEntry)", "return": "Document", "signature": "Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "testcase": false }, { "class_method_signature": "MongoTokenStore.documentToTokenEntry(Document document)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> documentToTokenEntry(Document document)", "identifier": "documentToTokenEntry", "modifiers": "private", "parameters": "(Document document)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> documentToTokenEntry(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.readSerializedData(Document document)", "constructor": false, "full_signature": "@SuppressWarnings(\"unchecked\") private T readSerializedData(Document document)", "identifier": "readSerializedData", "modifiers": "@SuppressWarnings(\"unchecked\") private", "parameters": "(Document document)", "return": "T", "signature": "T readSerializedData(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.ensureIndexes()", "constructor": false, "full_signature": "@Deprecated public void ensureIndexes()", "identifier": "ensureIndexes", "modifiers": "@Deprecated public", "parameters": "()", "return": "void", "signature": "void ensureIndexes()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public int[] fetchSegments(String processorName) {\n ArrayList<Integer> segments = mongoTemplate.trackingTokensCollection()\n .find(eq(\"processorName\", processorName))\n .sort(ascending(\"segment\"))\n .projection(fields(include(\"segment\"), excludeId()))\n .map(d -> d.get(\"segment\", Integer.class))\n .into(new ArrayList<>());\n // toArray doesn't work because of autoboxing limitations\n int[] ints = new int[segments.size()];\n for (int i = 0; i < ints.length; i++) {\n ints[i] = segments.get(i);\n }\n return ints;\n }", "class_method_signature": "MongoTokenStore.fetchSegments(String processorName)", "constructor": false, "full_signature": "@Override public int[] fetchSegments(String processorName)", "identifier": "fetchSegments", "invocations": [ "into", "map", "projection", "sort", "find", "trackingTokensCollection", "eq", "ascending", "fields", "include", "excludeId", "get", "size", "get" ], "modifiers": "@Override public", "parameters": "(String processorName)", "return": "int[]", "signature": "int[] fetchSegments(String processorName)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
153280357_0
{ "fields": [ { "declarator": "tokenStore", "modifier": "private", "original_string": "private MongoTokenStore tokenStore;", "type": "MongoTokenStore", "var_name": "tokenStore" }, { "declarator": "tokenStoreDifferentOwner", "modifier": "private", "original_string": "private MongoTokenStore tokenStoreDifferentOwner;", "type": "MongoTokenStore", "var_name": "tokenStoreDifferentOwner" }, { "declarator": "mongoExe", "modifier": "private static", "original_string": "private static MongodExecutable mongoExe;", "type": "MongodExecutable", "var_name": "mongoExe" }, { "declarator": "mongod", "modifier": "private static", "original_string": "private static MongodProcess mongod;", "type": "MongodProcess", "var_name": "mongod" }, { "declarator": "mongoTemplate", "modifier": "private", "original_string": "private MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "trackingTokensCollection", "modifier": "private", "original_string": "private MongoCollection<Document> trackingTokensCollection;", "type": "MongoCollection<Document>", "var_name": "trackingTokensCollection" }, { "declarator": "serializer", "modifier": "private", "original_string": "private Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout = Duration.ofSeconds(5)", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout = Duration.ofSeconds(5);", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "contentType = byte[].class", "modifier": "private final", "original_string": "private final Class<byte[]> contentType = byte[].class;", "type": "Class<byte[]>", "var_name": "contentType" }, { "declarator": "testProcessorName = \"testProcessorName\"", "modifier": "private final", "original_string": "private final String testProcessorName = \"testProcessorName\";", "type": "String", "var_name": "testProcessorName" }, { "declarator": "testSegment = 9", "modifier": "private final", "original_string": "private final int testSegment = 9;", "type": "int", "var_name": "testSegment" }, { "declarator": "testSegmentCount = 10", "modifier": "private final", "original_string": "private final int testSegmentCount = 10;", "type": "int", "var_name": "testSegmentCount" }, { "declarator": "testOwner = \"testOwner\"", "modifier": "private final", "original_string": "private final String testOwner = \"testOwner\";", "type": "String", "var_name": "testOwner" }, { "declarator": "context", "modifier": "@Autowired\n private", "original_string": "@Autowired\n private ApplicationContext context;", "type": "ApplicationContext", "var_name": "context" } ], "file": "mongo/src/test/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStoreTest.java", "identifier": "MongoTokenStoreTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n void testInitializeTokensWhileAlreadyPresent() {\n tokenStore.initializeTokenSegments(testProcessorName, testSegmentCount);\n assertThrows(\n UnableToClaimTokenException.class,\n () -> tokenStore.initializeTokenSegments(testProcessorName, testSegmentCount)\n );\n }", "class_method_signature": "MongoTokenStoreTest.testInitializeTokensWhileAlreadyPresent()", "constructor": false, "full_signature": "@Test void testInitializeTokensWhileAlreadyPresent()", "identifier": "testInitializeTokensWhileAlreadyPresent", "invocations": [ "initializeTokenSegments", "assertThrows", "initializeTokenSegments" ], "modifiers": "@Test", "parameters": "()", "return": "void", "signature": "void testInitializeTokensWhileAlreadyPresent()", "testcase": true }
{ "fields": [ { "declarator": "logger = LoggerFactory.getLogger(MongoTokenStore.class)", "modifier": "private final static", "original_string": "private final static Logger logger = LoggerFactory.getLogger(MongoTokenStore.class);", "type": "Logger", "var_name": "logger" }, { "declarator": "clock = Clock.systemUTC()", "modifier": "private final static", "original_string": "private final static Clock clock = Clock.systemUTC();", "type": "Clock", "var_name": "clock" }, { "declarator": "mongoTemplate", "modifier": "private final", "original_string": "private final MongoTemplate mongoTemplate;", "type": "MongoTemplate", "var_name": "mongoTemplate" }, { "declarator": "serializer", "modifier": "private final", "original_string": "private final Serializer serializer;", "type": "Serializer", "var_name": "serializer" }, { "declarator": "claimTimeout", "modifier": "private final", "original_string": "private final TemporalAmount claimTimeout;", "type": "TemporalAmount", "var_name": "claimTimeout" }, { "declarator": "nodeId", "modifier": "private final", "original_string": "private final String nodeId;", "type": "String", "var_name": "nodeId" }, { "declarator": "contentType", "modifier": "private final", "original_string": "private final Class<?> contentType;", "type": "Class<?>", "var_name": "contentType" } ], "file": "mongo/src/main/java/org/axonframework/extensions/mongo/eventsourcing/tokenstore/MongoTokenStore.java", "identifier": "MongoTokenStore", "interfaces": "implements TokenStore", "methods": [ { "class_method_signature": "MongoTokenStore.MongoTokenStore(Builder builder)", "constructor": true, "full_signature": "protected MongoTokenStore(Builder builder)", "identifier": "MongoTokenStore", "modifiers": "protected", "parameters": "(Builder builder)", "return": "", "signature": " MongoTokenStore(Builder builder)", "testcase": false }, { "class_method_signature": "MongoTokenStore.builder()", "constructor": false, "full_signature": "public static Builder builder()", "identifier": "builder", "modifiers": "public static", "parameters": "()", "return": "Builder", "signature": "Builder builder()", "testcase": false }, { "class_method_signature": "MongoTokenStore.storeToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "@Override public void storeToken(TrackingToken token, String processorName, int segment)", "identifier": "storeToken", "modifiers": "@Override public", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void storeToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.updateToken(TrackingToken token, String processorName, int segment)", "constructor": false, "full_signature": "private void updateToken(TrackingToken token, String processorName, int segment)", "identifier": "updateToken", "modifiers": "private", "parameters": "(TrackingToken token, String processorName, int segment)", "return": "void", "signature": "void updateToken(TrackingToken token, String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName, int segmentCount)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName, int segmentCount)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName, int segmentCount)", "return": "void", "signature": "void initializeTokenSegments(String processorName, int segmentCount)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "identifier": "initializeTokenSegments", "modifiers": "@Override public", "parameters": "(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "return": "void", "signature": "void initializeTokenSegments(String processorName,\n int segmentCount,\n TrackingToken initialToken)", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public TrackingToken fetchToken(String processorName, int segment)", "identifier": "fetchToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "TrackingToken", "signature": "TrackingToken fetchToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.loadToken(String processorName, int segment)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> loadToken(String processorName, int segment)", "identifier": "loadToken", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> loadToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.extendClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void extendClaim(String processorName, int segment)", "identifier": "extendClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void extendClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.releaseClaim(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void releaseClaim(String processorName, int segment)", "identifier": "releaseClaim", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void releaseClaim(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "constructor": false, "full_signature": "@Override public void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "identifier": "initializeSegment", "modifiers": "@Override public", "parameters": "(TrackingToken token,\n String processorName,\n int segment)", "return": "void", "signature": "void initializeSegment(TrackingToken token,\n String processorName,\n int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.deleteToken(String processorName, int segment)", "constructor": false, "full_signature": "@Override public void deleteToken(String processorName, int segment)", "identifier": "deleteToken", "modifiers": "@Override public", "parameters": "(String processorName, int segment)", "return": "void", "signature": "void deleteToken(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.requiresExplicitSegmentInitialization()", "constructor": false, "full_signature": "@Override public boolean requiresExplicitSegmentInitialization()", "identifier": "requiresExplicitSegmentInitialization", "modifiers": "@Override public", "parameters": "()", "return": "boolean", "signature": "boolean requiresExplicitSegmentInitialization()", "testcase": false }, { "class_method_signature": "MongoTokenStore.fetchSegments(String processorName)", "constructor": false, "full_signature": "@Override public int[] fetchSegments(String processorName)", "identifier": "fetchSegments", "modifiers": "@Override public", "parameters": "(String processorName)", "return": "int[]", "signature": "int[] fetchSegments(String processorName)", "testcase": false }, { "class_method_signature": "MongoTokenStore.claimableTokenEntryFilter(String processorName, int segment)", "constructor": false, "full_signature": "private Bson claimableTokenEntryFilter(String processorName, int segment)", "identifier": "claimableTokenEntryFilter", "modifiers": "private", "parameters": "(String processorName, int segment)", "return": "Bson", "signature": "Bson claimableTokenEntryFilter(String processorName, int segment)", "testcase": false }, { "class_method_signature": "MongoTokenStore.tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "constructor": false, "full_signature": "private Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "identifier": "tokenEntryToDocument", "modifiers": "private", "parameters": "(AbstractTokenEntry<?> tokenEntry)", "return": "Document", "signature": "Document tokenEntryToDocument(AbstractTokenEntry<?> tokenEntry)", "testcase": false }, { "class_method_signature": "MongoTokenStore.documentToTokenEntry(Document document)", "constructor": false, "full_signature": "private AbstractTokenEntry<?> documentToTokenEntry(Document document)", "identifier": "documentToTokenEntry", "modifiers": "private", "parameters": "(Document document)", "return": "AbstractTokenEntry<?>", "signature": "AbstractTokenEntry<?> documentToTokenEntry(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.readSerializedData(Document document)", "constructor": false, "full_signature": "@SuppressWarnings(\"unchecked\") private T readSerializedData(Document document)", "identifier": "readSerializedData", "modifiers": "@SuppressWarnings(\"unchecked\") private", "parameters": "(Document document)", "return": "T", "signature": "T readSerializedData(Document document)", "testcase": false }, { "class_method_signature": "MongoTokenStore.ensureIndexes()", "constructor": false, "full_signature": "@Deprecated public void ensureIndexes()", "identifier": "ensureIndexes", "modifiers": "@Deprecated public", "parameters": "()", "return": "void", "signature": "void ensureIndexes()", "testcase": false } ], "superclass": "" }
{ "body": "@Override\n public void initializeTokenSegments(String processorName, int segmentCount) throws UnableToClaimTokenException {\n initializeTokenSegments(processorName, segmentCount, null);\n }", "class_method_signature": "MongoTokenStore.initializeTokenSegments(String processorName, int segmentCount)", "constructor": false, "full_signature": "@Override public void initializeTokenSegments(String processorName, int segmentCount)", "identifier": "initializeTokenSegments", "invocations": [ "initializeTokenSegments" ], "modifiers": "@Override public", "parameters": "(String processorName, int segmentCount)", "return": "void", "signature": "void initializeTokenSegments(String processorName, int segmentCount)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 7, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 153280357, "size": 166, "stargazer_count": 6, "stars": null, "updates": null, "url": "https://github.com/AxonFramework/extension-mongo" }
124004218_77
{ "fields": [ { "declarator": "writer", "modifier": "private static", "original_string": "private static VectorContainerWriter writer;", "type": "VectorContainerWriter", "var_name": "writer" }, { "declarator": "mutator", "modifier": "private static", "original_string": "private static TestOutputMutator mutator;", "type": "TestOutputMutator", "var_name": "mutator" }, { "declarator": "bsonReader", "modifier": "private static", "original_string": "private static BsonRecordReader bsonReader;", "type": "BsonRecordReader", "var_name": "bsonReader" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java", "identifier": "TestBsonRecordReader", "interfaces": "", "superclass": "extends BaseTestQuery" }
{ "body": "@Test\n public void testSymbolType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"symbolKey\", new BsonSymbol(\"test_symbol\"));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(\"test_symbol\", mapReader.reader(\"symbolKey\").readText().toString());\n }", "class_method_signature": "TestBsonRecordReader.testSymbolType()", "constructor": false, "full_signature": "@Test public void testSymbolType()", "identifier": "testSymbolType", "invocations": [ "append", "reset", "write", "getReader", "getMapVector", "assertEquals", "toString", "readText", "reader" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testSymbolType()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)", "modifier": "static final", "original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "MAX_RECORD_SIZE = 128 * 1024", "modifier": "public final static", "original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;", "type": "int", "var_name": "MAX_RECORD_SIZE" }, { "declarator": "columns", "modifier": "private final", "original_string": "private final List<SchemaPath> columns;", "type": "List<SchemaPath>", "var_name": "columns" }, { "declarator": "atLeastOneWrite = false", "modifier": "private", "original_string": "private boolean atLeastOneWrite = false;", "type": "boolean", "var_name": "atLeastOneWrite" }, { "declarator": "readNumbersAsDouble", "modifier": "private final", "original_string": "private final boolean readNumbersAsDouble;", "type": "boolean", "var_name": "readNumbersAsDouble" }, { "declarator": "workBuf", "modifier": "protected", "original_string": "protected DrillBuf workBuf;", "type": "DrillBuf", "var_name": "workBuf" }, { "declarator": "currentFieldName", "modifier": "private", "original_string": "private String currentFieldName;", "type": "String", "var_name": "currentFieldName" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java", "identifier": "BsonRecordReader", "interfaces": "", "methods": [ { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "constructor": false, "full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "identifier": "writeToListOrMap", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "return": "void", "signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeTimeStamp", "modifiers": "private", "parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeString", "modifiers": "private", "parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeObjectId", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDouble", "modifiers": "private", "parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDateTime", "modifiers": "private", "parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBoolean", "modifiers": "private", "parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "constructor": false, "full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "return": "void", "signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt64", "modifiers": "private", "parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt32", "modifiers": "private", "parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)", "constructor": false, "full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)", "identifier": "ensureAtLeastOneField", "modifiers": "public", "parameters": "(ComplexWriter writer)", "return": "void", "signature": "void ensureAtLeastOneField(ComplexWriter writer)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(Throwable exception, String field, String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensure(final int length)", "constructor": false, "full_signature": "private void ensure(final int length)", "identifier": "ensure", "modifiers": "private", "parameters": "(final int length)", "return": "void", "signature": "void ensure(final int length)", "testcase": false } ], "superclass": "" }
{ "body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }", "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "invocations": [ "readStartDocument", "getCurrentBsonType", "writeToListOrMap", "rootAsMap" ], "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_20
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java", "identifier": "FileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListDirectoriesEmptyResult() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listDirectories(fs, base, false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().startsWith(\"abc\");\n }\n });\n assertEquals(\"Directory count should match\", 0, statuses.size());\n }", "class_method_signature": "FileSystemUtilTest.testListDirectoriesEmptyResult()", "constructor": false, "full_signature": "@Test public void testListDirectoriesEmptyResult()", "identifier": "testListDirectoriesEmptyResult", "invocations": [ "listDirectories", "startsWith", "getName", "assertEquals", "size" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListDirectoriesEmptyResult()", "testcase": true }
{ "fields": [ { "declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };", "type": "PathFilter", "var_name": "DUMMY_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java", "identifier": "FileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(PathFilter filter, PathFilter[] filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(final PathFilter... filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(final PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listDirectories", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listFiles", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listAll", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listDirectories(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }", "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "invocations": [ "listDirectories", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_36
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java", "identifier": "DrillFileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListDirectoriesRecursiveWithoutFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listDirectories(fs, base, true);\n assertEquals(\"Directory count should match\", 3, statuses.size());\n }", "class_method_signature": "DrillFileSystemUtilTest.testListDirectoriesRecursiveWithoutFilter()", "constructor": false, "full_signature": "@Test public void testListDirectoriesRecursiveWithoutFilter()", "identifier": "testListDirectoriesRecursiveWithoutFilter", "invocations": [ "listDirectories", "assertEquals", "size" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListDirectoriesRecursiveWithoutFilter()", "testcase": true }
{ "fields": [ { "declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };", "type": "PathFilter", "var_name": "DRILL_SYSTEM_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java", "identifier": "DrillFileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listDirectories(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }", "class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "invocations": [ "listDirectories", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_61
{ "fields": [ { "declarator": "built_in = \"built-in\"", "modifier": "private static final", "original_string": "private static final String built_in = \"built-in\";", "type": "String", "var_name": "built_in" }, { "declarator": "udf_jar = \"DrillUDF-1.0.jar\"", "modifier": "private static final", "original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";", "type": "String", "var_name": "udf_jar" }, { "declarator": "newJars", "modifier": "private static", "original_string": "private static Map<String, List<FunctionHolder>> newJars;", "type": "Map<String, List<FunctionHolder>>", "var_name": "newJars" }, { "declarator": "registryHolder", "modifier": "private", "original_string": "private FunctionRegistryHolder registryHolder;", "type": "FunctionRegistryHolder", "var_name": "registryHolder" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java", "identifier": "FunctionRegistryHolderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetAllFunctionsWithHolders() {\n ListMultimap<String, DrillFuncHolder> expectedResult = ArrayListMultimap.create();\n for (List<FunctionHolder> functionHolders : newJars.values()) {\n for(FunctionHolder functionHolder : functionHolders) {\n expectedResult.put(functionHolder.getName(), functionHolder.getHolder());\n }\n }\n compareListMultimaps(expectedResult, registryHolder.getAllFunctionsWithHolders());\n }", "class_method_signature": "FunctionRegistryHolderTest.testGetAllFunctionsWithHolders()", "constructor": false, "full_signature": "@Test public void testGetAllFunctionsWithHolders()", "identifier": "testGetAllFunctionsWithHolders", "invocations": [ "create", "values", "put", "getName", "getHolder", "compareListMultimaps", "getAllFunctionsWithHolders" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGetAllFunctionsWithHolders()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "readWriteLock = new ReentrantReadWriteLock()", "modifier": "private final", "original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();", "type": "ReadWriteLock", "var_name": "readWriteLock" }, { "declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())", "modifier": "private final", "original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());", "type": "AutoCloseableLock", "var_name": "readLock" }, { "declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())", "modifier": "private final", "original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());", "type": "AutoCloseableLock", "var_name": "writeLock" }, { "declarator": "version", "modifier": "private", "original_string": "private long version;", "type": "long", "var_name": "version" }, { "declarator": "jars", "modifier": "private final", "original_string": "private final Map<String, Map<String, Queue<String>>> jars;", "type": "Map<String, Map<String, Queue<String>>>", "var_name": "jars" }, { "declarator": "functions", "modifier": "private final", "original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;", "type": "Map<String, Map<String, DrillFuncHolder>>", "var_name": "functions" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java", "identifier": "FunctionRegistryHolder", "interfaces": "", "methods": [ { "class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()", "constructor": true, "full_signature": "public FunctionRegistryHolder()", "identifier": "FunctionRegistryHolder", "modifiers": "public", "parameters": "()", "return": "", "signature": " FunctionRegistryHolder()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getVersion()", "constructor": false, "full_signature": "public long getVersion()", "identifier": "getVersion", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getVersion()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)", "constructor": false, "full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "identifier": "addJars", "modifiers": "public", "parameters": "(Map<String, List<FunctionHolder>> newJars, long version)", "return": "void", "signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)", "constructor": false, "full_signature": "public void removeJar(String jarName)", "identifier": "removeJar", "modifiers": "public", "parameters": "(String jarName)", "return": "void", "signature": "void removeJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllJarNames()", "constructor": false, "full_signature": "public List<String> getAllJarNames()", "identifier": "getAllJarNames", "modifiers": "public", "parameters": "()", "return": "List<String>", "signature": "List<String> getAllJarNames()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)", "constructor": false, "full_signature": "public List<String> getFunctionNamesByJar(String jarName)", "identifier": "getFunctionNamesByJar", "modifiers": "public", "parameters": "(String jarName)", "return": "List<String>", "signature": "List<String> getFunctionNamesByJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "identifier": "getAllFunctionsWithHolders", "modifiers": "public", "parameters": "(AtomicLong version)", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()", "identifier": "getAllFunctionsWithHolders", "modifiers": "public", "parameters": "()", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()", "constructor": false, "full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()", "identifier": "getAllFunctionsWithSignatures", "modifiers": "public", "parameters": "()", "return": "ListMultimap<String, String>", "signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)", "constructor": false, "full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)", "identifier": "getHoldersByFunctionName", "modifiers": "public", "parameters": "(String functionName, AtomicLong version)", "return": "List<DrillFuncHolder>", "signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)", "constructor": false, "full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)", "identifier": "getHoldersByFunctionName", "modifiers": "public", "parameters": "(String functionName)", "return": "List<DrillFuncHolder>", "signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)", "constructor": false, "full_signature": "public boolean containsJar(String jarName)", "identifier": "containsJar", "modifiers": "public", "parameters": "(String jarName)", "return": "boolean", "signature": "boolean containsJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.functionsSize()", "constructor": false, "full_signature": "public int functionsSize()", "identifier": "functionsSize", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int functionsSize()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)", "constructor": false, "full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)", "identifier": "getJarNameByFunctionSignature", "modifiers": "public", "parameters": "(String functionName, String functionSignature)", "return": "String", "signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "constructor": false, "full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "identifier": "addFunctions", "modifiers": "private", "parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "return": "void", "signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)", "constructor": false, "full_signature": "private void removeAllByJar(String jarName)", "identifier": "removeAllByJar", "modifiers": "private", "parameters": "(String jarName)", "return": "void", "signature": "void removeAllByJar(String jarName)", "testcase": false } ], "superclass": "" }
{ "body": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version) {\n try (AutoCloseableLock lock = readLock.open()) {\n if (version != null) {\n version.set(this.version);\n }\n ListMultimap<String, DrillFuncHolder> functionsWithHolders = ArrayListMultimap.create();\n for (Map.Entry<String, Map<String, DrillFuncHolder>> function : functions.entrySet()) {\n functionsWithHolders.putAll(function.getKey(), Lists.newArrayList(function.getValue().values()));\n }\n return functionsWithHolders;\n }\n }", "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "identifier": "getAllFunctionsWithHolders", "invocations": [ "open", "set", "create", "entrySet", "putAll", "getKey", "newArrayList", "values", "getValue" ], "modifiers": "public", "parameters": "(AtomicLong version)", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_3
{ "fields": [ { "declarator": "MAX_ALLOCATION = 8 * 1024", "modifier": "private final static", "original_string": "private final static int MAX_ALLOCATION = 8 * 1024;", "type": "int", "var_name": "MAX_ALLOCATION" } ], "file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestBaseAllocator.java", "identifier": "TestBaseAllocator", "interfaces": "", "superclass": "" }
{ "body": "@Test(expected=IllegalStateException.class)\n public void testRootAllocator_closeWithOutstanding() throws Exception {\n try {\n try(final RootAllocator rootAllocator =\n new RootAllocator(MAX_ALLOCATION)) {\n final DrillBuf drillBuf = rootAllocator.buffer(512);\n assertNotNull(\"allocation failed\", drillBuf);\n }\n } finally {\n /*\n * We expect there to be one unreleased underlying buffer because we're closing\n * without releasing it.\n */\n/*\n // ------------------------------- DEBUG ---------------------------------\n final int bufferCount = UnsafeDirectLittleEndian.getBufferCount();\n UnsafeDirectLittleEndian.releaseBuffers();\n assertEquals(1, bufferCount);\n // ------------------------------- DEBUG ---------------------------------\n*/\n }\n }", "class_method_signature": "TestBaseAllocator.testRootAllocator_closeWithOutstanding()", "constructor": false, "full_signature": "@Test(expected=IllegalStateException.class) public void testRootAllocator_closeWithOutstanding()", "identifier": "testRootAllocator_closeWithOutstanding", "invocations": [ "buffer", "assertNotNull" ], "modifiers": "@Test(expected=IllegalStateException.class) public", "parameters": "()", "return": "void", "signature": "void testRootAllocator_closeWithOutstanding()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BaseAllocator.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\"", "modifier": "public static final", "original_string": "public static final String DEBUG_ALLOCATOR = \"drill.memory.debug.allocator\";", "type": "String", "var_name": "DEBUG_ALLOCATOR" }, { "declarator": "ID_GENERATOR = new AtomicLong(0)", "modifier": "@SuppressWarnings(\"unused\")\n private static final", "original_string": "@SuppressWarnings(\"unused\")\n private static final AtomicLong ID_GENERATOR = new AtomicLong(0);", "type": "AtomicLong", "var_name": "ID_GENERATOR" }, { "declarator": "CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize()", "modifier": "private static final", "original_string": "private static final int CHUNK_SIZE = AllocationManager.INNER_ALLOCATOR.getChunkSize();", "type": "int", "var_name": "CHUNK_SIZE" }, { "declarator": "DEBUG_LOG_LENGTH = 6", "modifier": "public static final", "original_string": "public static final int DEBUG_LOG_LENGTH = 6;", "type": "int", "var_name": "DEBUG_LOG_LENGTH" }, { "declarator": "DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"))", "modifier": "public static final", "original_string": "public static final boolean DEBUG = AssertionUtil.isAssertionsEnabled()\n || Boolean.parseBoolean(System.getProperty(DEBUG_ALLOCATOR, \"false\"));", "type": "boolean", "var_name": "DEBUG" }, { "declarator": "IO_BUFFER_SIZE = 32*1024", "modifier": "private static final", "original_string": "private static final int IO_BUFFER_SIZE = 32*1024;", "type": "int", "var_name": "IO_BUFFER_SIZE" }, { "declarator": "DEBUG_LOCK = DEBUG ? new Object() : null", "modifier": "private final", "original_string": "private final Object DEBUG_LOCK = DEBUG ? new Object() : null;", "type": "Object", "var_name": "DEBUG_LOCK" }, { "declarator": "parentAllocator", "modifier": "private final", "original_string": "private final BaseAllocator parentAllocator;", "type": "BaseAllocator", "var_name": "parentAllocator" }, { "declarator": "thisAsByteBufAllocator", "modifier": "private final", "original_string": "private final ByteBufAllocator thisAsByteBufAllocator;", "type": "ByteBufAllocator", "var_name": "thisAsByteBufAllocator" }, { "declarator": "childAllocators", "modifier": "private final", "original_string": "private final IdentityHashMap<BaseAllocator, Object> childAllocators;", "type": "IdentityHashMap<BaseAllocator, Object>", "var_name": "childAllocators" }, { "declarator": "empty", "modifier": "private final", "original_string": "private final DrillBuf empty;", "type": "DrillBuf", "var_name": "empty" }, { "declarator": "isClosed = false", "modifier": "private volatile", "original_string": "private volatile boolean isClosed = false;", "type": "boolean", "var_name": "isClosed" }, { "declarator": "name", "modifier": "final", "original_string": "final String name;", "type": "String", "var_name": "name" }, { "declarator": "root", "modifier": "final", "original_string": "final RootAllocator root;", "type": "RootAllocator", "var_name": "root" }, { "declarator": "childLedgers", "modifier": "private final", "original_string": "private final IdentityHashMap<BufferLedger, Object> childLedgers;", "type": "IdentityHashMap<BufferLedger, Object>", "var_name": "childLedgers" }, { "declarator": "reservations", "modifier": "private final", "original_string": "private final IdentityHashMap<Reservation, Object> reservations;", "type": "IdentityHashMap<Reservation, Object>", "var_name": "reservations" }, { "declarator": "historicalLog", "modifier": "private final", "original_string": "private final HistoricalLog historicalLog;", "type": "HistoricalLog", "var_name": "historicalLog" }, { "declarator": "ioBuffer[]", "modifier": "private", "original_string": "private byte ioBuffer[];", "type": "byte", "var_name": "ioBuffer" } ], "file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/BaseAllocator.java", "identifier": "BaseAllocator", "interfaces": "implements BufferAllocator", "methods": [ { "class_method_signature": "BaseAllocator.BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)", "constructor": true, "full_signature": "protected BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)", "identifier": "BaseAllocator", "modifiers": "protected", "parameters": "(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)", "return": "", "signature": " BaseAllocator(\n final BaseAllocator parentAllocator,\n final String name,\n final long initReservation,\n final long maxAllocation)", "testcase": false }, { "class_method_signature": "BaseAllocator.assertOpen()", "constructor": false, "full_signature": "@Override public void assertOpen()", "identifier": "assertOpen", "modifiers": "@Override public", "parameters": "()", "return": "void", "signature": "void assertOpen()", "testcase": false }, { "class_method_signature": "BaseAllocator.getName()", "constructor": false, "full_signature": "@Override public String getName()", "identifier": "getName", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String getName()", "testcase": false }, { "class_method_signature": "BaseAllocator.getEmpty()", "constructor": false, "full_signature": "@Override public DrillBuf getEmpty()", "identifier": "getEmpty", "modifiers": "@Override public", "parameters": "()", "return": "DrillBuf", "signature": "DrillBuf getEmpty()", "testcase": false }, { "class_method_signature": "BaseAllocator.associateLedger(BufferLedger ledger)", "constructor": false, "full_signature": " void associateLedger(BufferLedger ledger)", "identifier": "associateLedger", "modifiers": "", "parameters": "(BufferLedger ledger)", "return": "void", "signature": "void associateLedger(BufferLedger ledger)", "testcase": false }, { "class_method_signature": "BaseAllocator.dissociateLedger(BufferLedger ledger)", "constructor": false, "full_signature": " void dissociateLedger(BufferLedger ledger)", "identifier": "dissociateLedger", "modifiers": "", "parameters": "(BufferLedger ledger)", "return": "void", "signature": "void dissociateLedger(BufferLedger ledger)", "testcase": false }, { "class_method_signature": "BaseAllocator.childClosed(final BaseAllocator childAllocator)", "constructor": false, "full_signature": "private void childClosed(final BaseAllocator childAllocator)", "identifier": "childClosed", "modifiers": "private", "parameters": "(final BaseAllocator childAllocator)", "return": "void", "signature": "void childClosed(final BaseAllocator childAllocator)", "testcase": false }, { "class_method_signature": "BaseAllocator.createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)", "constructor": false, "full_signature": "private static String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)", "identifier": "createErrorMsg", "modifiers": "private static", "parameters": "(final BufferAllocator allocator, final int rounded, final int requested)", "return": "String", "signature": "String createErrorMsg(final BufferAllocator allocator, final int rounded, final int requested)", "testcase": false }, { "class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)", "constructor": false, "full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)", "identifier": "buffer", "modifiers": "@Override public", "parameters": "(final int initialRequestSize)", "return": "DrillBuf", "signature": "DrillBuf buffer(final int initialRequestSize)", "testcase": false }, { "class_method_signature": "BaseAllocator.createEmpty()", "constructor": false, "full_signature": "private DrillBuf createEmpty()", "identifier": "createEmpty", "modifiers": "private", "parameters": "()", "return": "DrillBuf", "signature": "DrillBuf createEmpty()", "testcase": false }, { "class_method_signature": "BaseAllocator.buffer(final int initialRequestSize, BufferManager manager)", "constructor": false, "full_signature": "@Override public DrillBuf buffer(final int initialRequestSize, BufferManager manager)", "identifier": "buffer", "modifiers": "@Override public", "parameters": "(final int initialRequestSize, BufferManager manager)", "return": "DrillBuf", "signature": "DrillBuf buffer(final int initialRequestSize, BufferManager manager)", "testcase": false }, { "class_method_signature": "BaseAllocator.bufferWithoutReservation(final int size, BufferManager bufferManager)", "constructor": false, "full_signature": "private DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)", "identifier": "bufferWithoutReservation", "modifiers": "private", "parameters": "(final int size, BufferManager bufferManager)", "return": "DrillBuf", "signature": "DrillBuf bufferWithoutReservation(final int size, BufferManager bufferManager)", "testcase": false }, { "class_method_signature": "BaseAllocator.getAsByteBufAllocator()", "constructor": false, "full_signature": "@Override public ByteBufAllocator getAsByteBufAllocator()", "identifier": "getAsByteBufAllocator", "modifiers": "@Override public", "parameters": "()", "return": "ByteBufAllocator", "signature": "ByteBufAllocator getAsByteBufAllocator()", "testcase": false }, { "class_method_signature": "BaseAllocator.newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)", "constructor": false, "full_signature": "@Override public BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)", "identifier": "newChildAllocator", "modifiers": "@Override public", "parameters": "(\n final String name,\n final long initReservation,\n final long maxAllocation)", "return": "BufferAllocator", "signature": "BufferAllocator newChildAllocator(\n final String name,\n final long initReservation,\n final long maxAllocation)", "testcase": false }, { "class_method_signature": "BaseAllocator.newReservation()", "constructor": false, "full_signature": "@Override public AllocationReservation newReservation()", "identifier": "newReservation", "modifiers": "@Override public", "parameters": "()", "return": "AllocationReservation", "signature": "AllocationReservation newReservation()", "testcase": false }, { "class_method_signature": "BaseAllocator.close()", "constructor": false, "full_signature": "@Override public synchronized void close()", "identifier": "close", "modifiers": "@Override public synchronized", "parameters": "()", "return": "void", "signature": "void close()", "testcase": false }, { "class_method_signature": "BaseAllocator.toString()", "constructor": false, "full_signature": "@Override public String toString()", "identifier": "toString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toString()", "testcase": false }, { "class_method_signature": "BaseAllocator.toVerboseString()", "constructor": false, "full_signature": "@Override public String toVerboseString()", "identifier": "toVerboseString", "modifiers": "@Override public", "parameters": "()", "return": "String", "signature": "String toVerboseString()", "testcase": false }, { "class_method_signature": "BaseAllocator.hist(String noteFormat, Object... args)", "constructor": false, "full_signature": "private void hist(String noteFormat, Object... args)", "identifier": "hist", "modifiers": "private", "parameters": "(String noteFormat, Object... args)", "return": "void", "signature": "void hist(String noteFormat, Object... args)", "testcase": false }, { "class_method_signature": "BaseAllocator.nextPowerOfTwo(int val)", "constructor": false, "full_signature": "public static int nextPowerOfTwo(int val)", "identifier": "nextPowerOfTwo", "modifiers": "public static", "parameters": "(int val)", "return": "int", "signature": "int nextPowerOfTwo(int val)", "testcase": false }, { "class_method_signature": "BaseAllocator.verifyAllocator()", "constructor": false, "full_signature": " void verifyAllocator()", "identifier": "verifyAllocator", "modifiers": "", "parameters": "()", "return": "void", "signature": "void verifyAllocator()", "testcase": false }, { "class_method_signature": "BaseAllocator.verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)", "constructor": false, "full_signature": "private void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)", "identifier": "verifyAllocator", "modifiers": "private", "parameters": "(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)", "return": "void", "signature": "void verifyAllocator(final IdentityHashMap<UnsafeDirectLittleEndian, BaseAllocator> buffersSeen)", "testcase": false }, { "class_method_signature": "BaseAllocator.print(StringBuilder sb, int level, Verbosity verbosity)", "constructor": false, "full_signature": " void print(StringBuilder sb, int level, Verbosity verbosity)", "identifier": "print", "modifiers": "", "parameters": "(StringBuilder sb, int level, Verbosity verbosity)", "return": "void", "signature": "void print(StringBuilder sb, int level, Verbosity verbosity)", "testcase": false }, { "class_method_signature": "BaseAllocator.dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)", "constructor": false, "full_signature": "private void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)", "identifier": "dumpBuffers", "modifiers": "private", "parameters": "(final StringBuilder sb, final Set<BufferLedger> ledgerSet)", "return": "void", "signature": "void dumpBuffers(final StringBuilder sb, final Set<BufferLedger> ledgerSet)", "testcase": false }, { "class_method_signature": "BaseAllocator.indent(StringBuilder sb, int indent)", "constructor": false, "full_signature": "public static StringBuilder indent(StringBuilder sb, int indent)", "identifier": "indent", "modifiers": "public static", "parameters": "(StringBuilder sb, int indent)", "return": "StringBuilder", "signature": "StringBuilder indent(StringBuilder sb, int indent)", "testcase": false }, { "class_method_signature": "BaseAllocator.isDebug()", "constructor": false, "full_signature": "public static boolean isDebug()", "identifier": "isDebug", "modifiers": "public static", "parameters": "()", "return": "boolean", "signature": "boolean isDebug()", "testcase": false }, { "class_method_signature": "BaseAllocator.getIOBuffer()", "constructor": false, "full_signature": "public byte[] getIOBuffer()", "identifier": "getIOBuffer", "modifiers": "public", "parameters": "()", "return": "byte[]", "signature": "byte[] getIOBuffer()", "testcase": false }, { "class_method_signature": "BaseAllocator.read(DrillBuf buf, int length, InputStream in)", "constructor": false, "full_signature": "@Override public void read(DrillBuf buf, int length, InputStream in)", "identifier": "read", "modifiers": "@Override public", "parameters": "(DrillBuf buf, int length, InputStream in)", "return": "void", "signature": "void read(DrillBuf buf, int length, InputStream in)", "testcase": false }, { "class_method_signature": "BaseAllocator.read(int length, InputStream in)", "constructor": false, "full_signature": "public DrillBuf read(int length, InputStream in)", "identifier": "read", "modifiers": "public", "parameters": "(int length, InputStream in)", "return": "DrillBuf", "signature": "DrillBuf read(int length, InputStream in)", "testcase": false }, { "class_method_signature": "BaseAllocator.write(DrillBuf buf, OutputStream out)", "constructor": false, "full_signature": "@Override public void write(DrillBuf buf, OutputStream out)", "identifier": "write", "modifiers": "@Override public", "parameters": "(DrillBuf buf, OutputStream out)", "return": "void", "signature": "void write(DrillBuf buf, OutputStream out)", "testcase": false }, { "class_method_signature": "BaseAllocator.write(DrillBuf buf, int length, OutputStream out)", "constructor": false, "full_signature": "@Override public void write(DrillBuf buf, int length, OutputStream out)", "identifier": "write", "modifiers": "@Override public", "parameters": "(DrillBuf buf, int length, OutputStream out)", "return": "void", "signature": "void write(DrillBuf buf, int length, OutputStream out)", "testcase": false } ], "superclass": "extends Accountant" }
{ "body": "@Override\n public DrillBuf buffer(final int initialRequestSize) {\n assertOpen();\n\n return buffer(initialRequestSize, null);\n }", "class_method_signature": "BaseAllocator.buffer(final int initialRequestSize)", "constructor": false, "full_signature": "@Override public DrillBuf buffer(final int initialRequestSize)", "identifier": "buffer", "invocations": [ "assertOpen", "buffer" ], "modifiers": "@Override public", "parameters": "(final int initialRequestSize)", "return": "DrillBuf", "signature": "DrillBuf buffer(final int initialRequestSize)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_94
{ "fields": [ { "declarator": "FULL_PERMISSION = FsPermission.getDirDefault()", "modifier": "private static final", "original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();", "type": "FsPermission", "var_name": "FULL_PERMISSION" }, { "declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)", "modifier": "private static final", "original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);", "type": "StorageStrategy", "var_name": "PERSISTENT_STRATEGY" }, { "declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)", "modifier": "private static final", "original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);", "type": "StorageStrategy", "var_name": "TEMPORARY_STRATEGY" }, { "declarator": "fs", "modifier": "private static", "original_string": "private static FileSystem fs;", "type": "FileSystem", "var_name": "fs" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java", "identifier": "StorageStrategyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCreatePathAndDeleteOnExitFalse() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path resultPath = addNLevelsAndFile(initialPath, 2, false);\n Path firstCreatedParentPath = addNLevelsAndFile(initialPath, 1, false);\n\n Path createdParentPath = PERSISTENT_STRATEGY.createPathAndApply(fs, resultPath);\n\n assertEquals(\"Path should match\", firstCreatedParentPath, createdParentPath);\n checkPathAndPermission(initialPath, resultPath, false, 2, PERSISTENT_STRATEGY);\n checkDeleteOnExit(firstCreatedParentPath, false);\n }", "class_method_signature": "StorageStrategyTest.testCreatePathAndDeleteOnExitFalse()", "constructor": false, "full_signature": "@Test public void testCreatePathAndDeleteOnExitFalse()", "identifier": "testCreatePathAndDeleteOnExitFalse", "invocations": [ "prepareStorageDirectory", "addNLevelsAndFile", "addNLevelsAndFile", "createPathAndApply", "assertEquals", "checkPathAndPermission", "checkDeleteOnExit" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testCreatePathAndDeleteOnExitFalse()", "testcase": true }
{ "fields": [ { "declarator": "DEFAULT = new StorageStrategy(\"002\", false)", "modifier": "public static final", "original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);", "type": "StorageStrategy", "var_name": "DEFAULT" }, { "declarator": "TEMPORARY = new StorageStrategy(\"077\", true)", "modifier": "public static final", "original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);", "type": "StorageStrategy", "var_name": "TEMPORARY" }, { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "umask", "modifier": "private final", "original_string": "private final String umask;", "type": "String", "var_name": "umask" }, { "declarator": "deleteOnExit", "modifier": "private final", "original_string": "private final boolean deleteOnExit;", "type": "boolean", "var_name": "deleteOnExit" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java", "identifier": "StorageStrategy", "interfaces": "", "methods": [ { "class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "constructor": true, "full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "identifier": "StorageStrategy", "modifiers": "@JsonCreator public", "parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "return": "", "signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "testcase": false }, { "class_method_signature": "StorageStrategy.getUmask()", "constructor": false, "full_signature": "public String getUmask()", "identifier": "getUmask", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getUmask()", "testcase": false }, { "class_method_signature": "StorageStrategy.isDeleteOnExit()", "constructor": false, "full_signature": "public boolean isDeleteOnExit()", "identifier": "isDeleteOnExit", "modifiers": "public", "parameters": "()", "return": "boolean", "signature": "boolean isDeleteOnExit()", "testcase": false }, { "class_method_signature": "StorageStrategy.getFolderPermission()", "constructor": false, "full_signature": "@JsonIgnore public FsPermission getFolderPermission()", "identifier": "getFolderPermission", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "FsPermission", "signature": "FsPermission getFolderPermission()", "testcase": false }, { "class_method_signature": "StorageStrategy.getFilePermission()", "constructor": false, "full_signature": "@JsonIgnore public FsPermission getFilePermission()", "identifier": "getFilePermission", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "FsPermission", "signature": "FsPermission getFilePermission()", "testcase": false }, { "class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)", "constructor": false, "full_signature": "public Path createPathAndApply(FileSystem fs, Path path)", "identifier": "createPathAndApply", "modifiers": "public", "parameters": "(FileSystem fs, Path path)", "return": "Path", "signature": "Path createPathAndApply(FileSystem fs, Path path)", "testcase": false }, { "class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)", "constructor": false, "full_signature": "public Path createFileAndApply(FileSystem fs, Path file)", "identifier": "createFileAndApply", "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "Path", "signature": "Path createFileAndApply(FileSystem fs, Path file)", "testcase": false }, { "class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)", "constructor": false, "full_signature": "public void applyToFile(FileSystem fs, Path file)", "identifier": "applyToFile", "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "void", "signature": "void applyToFile(FileSystem fs, Path file)", "testcase": false }, { "class_method_signature": "StorageStrategy.validateUmask(String umask)", "constructor": false, "full_signature": "private String validateUmask(String umask)", "identifier": "validateUmask", "modifiers": "private", "parameters": "(String umask)", "return": "String", "signature": "String validateUmask(String umask)", "testcase": false }, { "class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)", "constructor": false, "full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)", "identifier": "getNonExistentLocations", "modifiers": "private", "parameters": "(FileSystem fs, Path path)", "return": "List<Path>", "signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)", "testcase": false }, { "class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "constructor": false, "full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "identifier": "applyStrategy", "modifiers": "private", "parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "return": "void", "signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "testcase": false } ], "superclass": "" }
{ "body": "public Path createPathAndApply(FileSystem fs, Path path) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, path);\n if (locations.isEmpty()) {\n return null;\n }\n fs.mkdirs(path);\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }", "class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)", "constructor": false, "full_signature": "public Path createPathAndApply(FileSystem fs, Path path)", "identifier": "createPathAndApply", "invocations": [ "getNonExistentLocations", "isEmpty", "mkdirs", "applyStrategy", "getFolderPermission", "get", "size" ], "modifiers": "public", "parameters": "(FileSystem fs, Path path)", "return": "Path", "signature": "Path createPathAndApply(FileSystem fs, Path path)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_82
{ "fields": [ { "declarator": "writer", "modifier": "private static", "original_string": "private static VectorContainerWriter writer;", "type": "VectorContainerWriter", "var_name": "writer" }, { "declarator": "mutator", "modifier": "private static", "original_string": "private static TestOutputMutator mutator;", "type": "TestOutputMutator", "var_name": "mutator" }, { "declarator": "bsonReader", "modifier": "private static", "original_string": "private static BsonRecordReader bsonReader;", "type": "BsonRecordReader", "var_name": "bsonReader" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java", "identifier": "TestBsonRecordReader", "interfaces": "", "superclass": "extends BaseTestQuery" }
{ "body": "@Test\n public void testDoubleType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"doubleKey\", new BsonDouble(12.35));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(12.35d, mapReader.reader(\"doubleKey\").readDouble().doubleValue(), 0.00001);\n }", "class_method_signature": "TestBsonRecordReader.testDoubleType()", "constructor": false, "full_signature": "@Test public void testDoubleType()", "identifier": "testDoubleType", "invocations": [ "append", "reset", "write", "getReader", "getMapVector", "assertEquals", "doubleValue", "readDouble", "reader" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testDoubleType()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)", "modifier": "static final", "original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "MAX_RECORD_SIZE = 128 * 1024", "modifier": "public final static", "original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;", "type": "int", "var_name": "MAX_RECORD_SIZE" }, { "declarator": "columns", "modifier": "private final", "original_string": "private final List<SchemaPath> columns;", "type": "List<SchemaPath>", "var_name": "columns" }, { "declarator": "atLeastOneWrite = false", "modifier": "private", "original_string": "private boolean atLeastOneWrite = false;", "type": "boolean", "var_name": "atLeastOneWrite" }, { "declarator": "readNumbersAsDouble", "modifier": "private final", "original_string": "private final boolean readNumbersAsDouble;", "type": "boolean", "var_name": "readNumbersAsDouble" }, { "declarator": "workBuf", "modifier": "protected", "original_string": "protected DrillBuf workBuf;", "type": "DrillBuf", "var_name": "workBuf" }, { "declarator": "currentFieldName", "modifier": "private", "original_string": "private String currentFieldName;", "type": "String", "var_name": "currentFieldName" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java", "identifier": "BsonRecordReader", "interfaces": "", "methods": [ { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "constructor": false, "full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "identifier": "writeToListOrMap", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "return": "void", "signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeTimeStamp", "modifiers": "private", "parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeString", "modifiers": "private", "parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeObjectId", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDouble", "modifiers": "private", "parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDateTime", "modifiers": "private", "parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBoolean", "modifiers": "private", "parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "constructor": false, "full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "return": "void", "signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt64", "modifiers": "private", "parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt32", "modifiers": "private", "parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)", "constructor": false, "full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)", "identifier": "ensureAtLeastOneField", "modifiers": "public", "parameters": "(ComplexWriter writer)", "return": "void", "signature": "void ensureAtLeastOneField(ComplexWriter writer)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(Throwable exception, String field, String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensure(final int length)", "constructor": false, "full_signature": "private void ensure(final int length)", "identifier": "ensure", "modifiers": "private", "parameters": "(final int length)", "return": "void", "signature": "void ensure(final int length)", "testcase": false } ], "superclass": "" }
{ "body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }", "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "invocations": [ "readStartDocument", "getCurrentBsonType", "writeToListOrMap", "rootAsMap" ], "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_16
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java", "identifier": "FileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListDirectoriesWithoutFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listDirectories(fs, base, false);\n assertEquals(\"Directory count should match\", 4, statuses.size());\n }", "class_method_signature": "FileSystemUtilTest.testListDirectoriesWithoutFilter()", "constructor": false, "full_signature": "@Test public void testListDirectoriesWithoutFilter()", "identifier": "testListDirectoriesWithoutFilter", "invocations": [ "listDirectories", "assertEquals", "size" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListDirectoriesWithoutFilter()", "testcase": true }
{ "fields": [ { "declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };", "type": "PathFilter", "var_name": "DUMMY_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java", "identifier": "FileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(PathFilter filter, PathFilter[] filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(final PathFilter... filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(final PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listDirectories", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listFiles", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listAll", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listDirectories(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }", "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "invocations": [ "listDirectories", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_41
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java", "identifier": "DrillFileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListFilesRecursiveWithFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listFiles(fs, base, true, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\") || path.getName().endsWith(\".txt\");\n }\n });\n assertEquals(\"File count should match\", 2, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(0).getPath().getName());\n assertEquals(\"File name should match\", \"f.txt\", statuses.get(1).getPath().getName());\n }", "class_method_signature": "DrillFileSystemUtilTest.testListFilesRecursiveWithFilter()", "constructor": false, "full_signature": "@Test public void testListFilesRecursiveWithFilter()", "identifier": "testListFilesRecursiveWithFilter", "invocations": [ "listFiles", "endsWith", "getName", "endsWith", "getName", "assertEquals", "size", "sort", "assertEquals", "getName", "getPath", "get", "assertEquals", "getName", "getPath", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListFilesRecursiveWithFilter()", "testcase": true }
{ "fields": [ { "declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };", "type": "PathFilter", "var_name": "DRILL_SYSTEM_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java", "identifier": "DrillFileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listFiles(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }", "class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "invocations": [ "listFiles", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_57
{ "fields": [ { "declarator": "built_in = \"built-in\"", "modifier": "private static final", "original_string": "private static final String built_in = \"built-in\";", "type": "String", "var_name": "built_in" }, { "declarator": "udf_jar = \"DrillUDF-1.0.jar\"", "modifier": "private static final", "original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";", "type": "String", "var_name": "udf_jar" }, { "declarator": "newJars", "modifier": "private static", "original_string": "private static Map<String, List<FunctionHolder>> newJars;", "type": "Map<String, List<FunctionHolder>>", "var_name": "newJars" }, { "declarator": "registryHolder", "modifier": "private", "original_string": "private FunctionRegistryHolder registryHolder;", "type": "FunctionRegistryHolder", "var_name": "registryHolder" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java", "identifier": "FunctionRegistryHolderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testAddJars() {\n resetRegistry();\n int functionsSize = 0;\n List<String> jars = Lists.newArrayList();\n ListMultimap<String, DrillFuncHolder> functionsWithHolders = ArrayListMultimap.create();\n ListMultimap<String, String> functionsWithSignatures = ArrayListMultimap.create();\n for (Map.Entry<String, List<FunctionHolder>> jar : newJars.entrySet()) {\n jars.add(jar.getKey());\n for (FunctionHolder functionHolder : jar.getValue()) {\n functionsWithHolders.put(functionHolder.getName(), functionHolder.getHolder());\n functionsWithSignatures.put(functionHolder.getName(), functionHolder.getSignature());\n functionsSize++;\n }\n }\n\n long expectedVersion = 0;\n registryHolder.addJars(newJars, ++expectedVersion);\n assertEquals(\"Version number should match\", expectedVersion, registryHolder.getVersion());\n compareTwoLists(jars, registryHolder.getAllJarNames());\n assertEquals(functionsSize, registryHolder.functionsSize());\n compareListMultimaps(functionsWithHolders, registryHolder.getAllFunctionsWithHolders());\n compareListMultimaps(functionsWithSignatures, registryHolder.getAllFunctionsWithSignatures());\n }", "class_method_signature": "FunctionRegistryHolderTest.testAddJars()", "constructor": false, "full_signature": "@Test public void testAddJars()", "identifier": "testAddJars", "invocations": [ "resetRegistry", "newArrayList", "create", "create", "entrySet", "add", "getKey", "getValue", "put", "getName", "getHolder", "put", "getName", "getSignature", "addJars", "assertEquals", "getVersion", "compareTwoLists", "getAllJarNames", "assertEquals", "functionsSize", "compareListMultimaps", "getAllFunctionsWithHolders", "compareListMultimaps", "getAllFunctionsWithSignatures" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testAddJars()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "readWriteLock = new ReentrantReadWriteLock()", "modifier": "private final", "original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();", "type": "ReadWriteLock", "var_name": "readWriteLock" }, { "declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())", "modifier": "private final", "original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());", "type": "AutoCloseableLock", "var_name": "readLock" }, { "declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())", "modifier": "private final", "original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());", "type": "AutoCloseableLock", "var_name": "writeLock" }, { "declarator": "version", "modifier": "private", "original_string": "private long version;", "type": "long", "var_name": "version" }, { "declarator": "jars", "modifier": "private final", "original_string": "private final Map<String, Map<String, Queue<String>>> jars;", "type": "Map<String, Map<String, Queue<String>>>", "var_name": "jars" }, { "declarator": "functions", "modifier": "private final", "original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;", "type": "Map<String, Map<String, DrillFuncHolder>>", "var_name": "functions" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java", "identifier": "FunctionRegistryHolder", "interfaces": "", "methods": [ { "class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()", "constructor": true, "full_signature": "public FunctionRegistryHolder()", "identifier": "FunctionRegistryHolder", "modifiers": "public", "parameters": "()", "return": "", "signature": " FunctionRegistryHolder()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getVersion()", "constructor": false, "full_signature": "public long getVersion()", "identifier": "getVersion", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getVersion()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)", "constructor": false, "full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "identifier": "addJars", "modifiers": "public", "parameters": "(Map<String, List<FunctionHolder>> newJars, long version)", "return": "void", "signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)", "constructor": false, "full_signature": "public void removeJar(String jarName)", "identifier": "removeJar", "modifiers": "public", "parameters": "(String jarName)", "return": "void", "signature": "void removeJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllJarNames()", "constructor": false, "full_signature": "public List<String> getAllJarNames()", "identifier": "getAllJarNames", "modifiers": "public", "parameters": "()", "return": "List<String>", "signature": "List<String> getAllJarNames()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)", "constructor": false, "full_signature": "public List<String> getFunctionNamesByJar(String jarName)", "identifier": "getFunctionNamesByJar", "modifiers": "public", "parameters": "(String jarName)", "return": "List<String>", "signature": "List<String> getFunctionNamesByJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "identifier": "getAllFunctionsWithHolders", "modifiers": "public", "parameters": "(AtomicLong version)", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()", "identifier": "getAllFunctionsWithHolders", "modifiers": "public", "parameters": "()", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()", "constructor": false, "full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()", "identifier": "getAllFunctionsWithSignatures", "modifiers": "public", "parameters": "()", "return": "ListMultimap<String, String>", "signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)", "constructor": false, "full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)", "identifier": "getHoldersByFunctionName", "modifiers": "public", "parameters": "(String functionName, AtomicLong version)", "return": "List<DrillFuncHolder>", "signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)", "constructor": false, "full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)", "identifier": "getHoldersByFunctionName", "modifiers": "public", "parameters": "(String functionName)", "return": "List<DrillFuncHolder>", "signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)", "constructor": false, "full_signature": "public boolean containsJar(String jarName)", "identifier": "containsJar", "modifiers": "public", "parameters": "(String jarName)", "return": "boolean", "signature": "boolean containsJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.functionsSize()", "constructor": false, "full_signature": "public int functionsSize()", "identifier": "functionsSize", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int functionsSize()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)", "constructor": false, "full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)", "identifier": "getJarNameByFunctionSignature", "modifiers": "public", "parameters": "(String functionName, String functionSignature)", "return": "String", "signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "constructor": false, "full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "identifier": "addFunctions", "modifiers": "private", "parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "return": "void", "signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)", "constructor": false, "full_signature": "private void removeAllByJar(String jarName)", "identifier": "removeAllByJar", "modifiers": "private", "parameters": "(String jarName)", "return": "void", "signature": "void removeAllByJar(String jarName)", "testcase": false } ], "superclass": "" }
{ "body": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version) {\n try (AutoCloseableLock lock = writeLock.open()) {\n for (Map.Entry<String, List<FunctionHolder>> newJar : newJars.entrySet()) {\n String jarName = newJar.getKey();\n removeAllByJar(jarName);\n Map<String, Queue<String>> jar = Maps.newConcurrentMap();\n jars.put(jarName, jar);\n addFunctions(jar, newJar.getValue());\n }\n this.version = version;\n }\n }", "class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)", "constructor": false, "full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "identifier": "addJars", "invocations": [ "open", "entrySet", "getKey", "removeAllByJar", "newConcurrentMap", "put", "addFunctions", "getValue" ], "modifiers": "public", "parameters": "(Map<String, List<FunctionHolder>> newJars, long version)", "return": "void", "signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_40
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java", "identifier": "DrillFileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListFilesRecursiveWithoutFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listFiles(fs, base, true);\n assertEquals(\"File count should match\", 3, statuses.size());\n }", "class_method_signature": "DrillFileSystemUtilTest.testListFilesRecursiveWithoutFilter()", "constructor": false, "full_signature": "@Test public void testListFilesRecursiveWithoutFilter()", "identifier": "testListFilesRecursiveWithoutFilter", "invocations": [ "listFiles", "assertEquals", "size" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListFilesRecursiveWithoutFilter()", "testcase": true }
{ "fields": [ { "declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };", "type": "PathFilter", "var_name": "DRILL_SYSTEM_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java", "identifier": "DrillFileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listFiles(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }", "class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "invocations": [ "listFiles", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_17
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java", "identifier": "FileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListDirectoriesWithFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listDirectories(fs, base, false, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\");\n }\n });\n assertEquals(\"Directory count should match\", 3, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"Directory name should match\", \".a\", statuses.get(0).getPath().getName());\n assertEquals(\"Directory name should match\", \"_a\", statuses.get(1).getPath().getName());\n assertEquals(\"Directory name should match\", \"a\", statuses.get(2).getPath().getName());\n }", "class_method_signature": "FileSystemUtilTest.testListDirectoriesWithFilter()", "constructor": false, "full_signature": "@Test public void testListDirectoriesWithFilter()", "identifier": "testListDirectoriesWithFilter", "invocations": [ "listDirectories", "endsWith", "getName", "assertEquals", "size", "sort", "assertEquals", "getName", "getPath", "get", "assertEquals", "getName", "getPath", "get", "assertEquals", "getName", "getPath", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListDirectoriesWithFilter()", "testcase": true }
{ "fields": [ { "declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };", "type": "PathFilter", "var_name": "DUMMY_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java", "identifier": "FileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(PathFilter filter, PathFilter[] filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(final PathFilter... filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(final PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listDirectories", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listFiles", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listAll", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listDirectories(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }", "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "invocations": [ "listDirectories", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_83
{ "fields": [ { "declarator": "writer", "modifier": "private static", "original_string": "private static VectorContainerWriter writer;", "type": "VectorContainerWriter", "var_name": "writer" }, { "declarator": "mutator", "modifier": "private static", "original_string": "private static TestOutputMutator mutator;", "type": "TestOutputMutator", "var_name": "mutator" }, { "declarator": "bsonReader", "modifier": "private static", "original_string": "private static BsonRecordReader bsonReader;", "type": "BsonRecordReader", "var_name": "bsonReader" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java", "identifier": "TestBsonRecordReader", "interfaces": "", "superclass": "extends BaseTestQuery" }
{ "body": "@Test\n public void testDateTimeType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"dateTimeKey\", new BsonDateTime(5262729712L));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(5262729712L, mapReader.reader(\"dateTimeKey\").readDateTime().getMillis());\n }", "class_method_signature": "TestBsonRecordReader.testDateTimeType()", "constructor": false, "full_signature": "@Test public void testDateTimeType()", "identifier": "testDateTimeType", "invocations": [ "append", "reset", "write", "getReader", "getMapVector", "assertEquals", "getMillis", "readDateTime", "reader" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testDateTimeType()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)", "modifier": "static final", "original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "MAX_RECORD_SIZE = 128 * 1024", "modifier": "public final static", "original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;", "type": "int", "var_name": "MAX_RECORD_SIZE" }, { "declarator": "columns", "modifier": "private final", "original_string": "private final List<SchemaPath> columns;", "type": "List<SchemaPath>", "var_name": "columns" }, { "declarator": "atLeastOneWrite = false", "modifier": "private", "original_string": "private boolean atLeastOneWrite = false;", "type": "boolean", "var_name": "atLeastOneWrite" }, { "declarator": "readNumbersAsDouble", "modifier": "private final", "original_string": "private final boolean readNumbersAsDouble;", "type": "boolean", "var_name": "readNumbersAsDouble" }, { "declarator": "workBuf", "modifier": "protected", "original_string": "protected DrillBuf workBuf;", "type": "DrillBuf", "var_name": "workBuf" }, { "declarator": "currentFieldName", "modifier": "private", "original_string": "private String currentFieldName;", "type": "String", "var_name": "currentFieldName" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java", "identifier": "BsonRecordReader", "interfaces": "", "methods": [ { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "constructor": false, "full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "identifier": "writeToListOrMap", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "return": "void", "signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeTimeStamp", "modifiers": "private", "parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeString", "modifiers": "private", "parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeObjectId", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDouble", "modifiers": "private", "parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDateTime", "modifiers": "private", "parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBoolean", "modifiers": "private", "parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "constructor": false, "full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "return": "void", "signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt64", "modifiers": "private", "parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt32", "modifiers": "private", "parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)", "constructor": false, "full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)", "identifier": "ensureAtLeastOneField", "modifiers": "public", "parameters": "(ComplexWriter writer)", "return": "void", "signature": "void ensureAtLeastOneField(ComplexWriter writer)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(Throwable exception, String field, String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensure(final int length)", "constructor": false, "full_signature": "private void ensure(final int length)", "identifier": "ensure", "modifiers": "private", "parameters": "(final int length)", "return": "void", "signature": "void ensure(final int length)", "testcase": false } ], "superclass": "" }
{ "body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }", "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "invocations": [ "readStartDocument", "getCurrentBsonType", "writeToListOrMap", "rootAsMap" ], "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_95
{ "fields": [ { "declarator": "FULL_PERMISSION = FsPermission.getDirDefault()", "modifier": "private static final", "original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();", "type": "FsPermission", "var_name": "FULL_PERMISSION" }, { "declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)", "modifier": "private static final", "original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);", "type": "StorageStrategy", "var_name": "PERSISTENT_STRATEGY" }, { "declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)", "modifier": "private static final", "original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);", "type": "StorageStrategy", "var_name": "TEMPORARY_STRATEGY" }, { "declarator": "fs", "modifier": "private static", "original_string": "private static FileSystem fs;", "type": "FileSystem", "var_name": "fs" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java", "identifier": "StorageStrategyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testCreatePathAndDeleteOnExitTrue() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path resultPath = addNLevelsAndFile(initialPath, 2, false);\n Path firstCreatedParentPath = addNLevelsAndFile(initialPath, 1, false);\n\n Path createdParentPath = TEMPORARY_STRATEGY.createPathAndApply(fs, resultPath);\n\n assertEquals(\"Path should match\", firstCreatedParentPath, createdParentPath);\n checkPathAndPermission(initialPath, resultPath, false, 2, TEMPORARY_STRATEGY);\n checkDeleteOnExit(firstCreatedParentPath, true);\n }", "class_method_signature": "StorageStrategyTest.testCreatePathAndDeleteOnExitTrue()", "constructor": false, "full_signature": "@Test public void testCreatePathAndDeleteOnExitTrue()", "identifier": "testCreatePathAndDeleteOnExitTrue", "invocations": [ "prepareStorageDirectory", "addNLevelsAndFile", "addNLevelsAndFile", "createPathAndApply", "assertEquals", "checkPathAndPermission", "checkDeleteOnExit" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testCreatePathAndDeleteOnExitTrue()", "testcase": true }
{ "fields": [ { "declarator": "DEFAULT = new StorageStrategy(\"002\", false)", "modifier": "public static final", "original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);", "type": "StorageStrategy", "var_name": "DEFAULT" }, { "declarator": "TEMPORARY = new StorageStrategy(\"077\", true)", "modifier": "public static final", "original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);", "type": "StorageStrategy", "var_name": "TEMPORARY" }, { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "umask", "modifier": "private final", "original_string": "private final String umask;", "type": "String", "var_name": "umask" }, { "declarator": "deleteOnExit", "modifier": "private final", "original_string": "private final boolean deleteOnExit;", "type": "boolean", "var_name": "deleteOnExit" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java", "identifier": "StorageStrategy", "interfaces": "", "methods": [ { "class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "constructor": true, "full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "identifier": "StorageStrategy", "modifiers": "@JsonCreator public", "parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "return": "", "signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "testcase": false }, { "class_method_signature": "StorageStrategy.getUmask()", "constructor": false, "full_signature": "public String getUmask()", "identifier": "getUmask", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getUmask()", "testcase": false }, { "class_method_signature": "StorageStrategy.isDeleteOnExit()", "constructor": false, "full_signature": "public boolean isDeleteOnExit()", "identifier": "isDeleteOnExit", "modifiers": "public", "parameters": "()", "return": "boolean", "signature": "boolean isDeleteOnExit()", "testcase": false }, { "class_method_signature": "StorageStrategy.getFolderPermission()", "constructor": false, "full_signature": "@JsonIgnore public FsPermission getFolderPermission()", "identifier": "getFolderPermission", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "FsPermission", "signature": "FsPermission getFolderPermission()", "testcase": false }, { "class_method_signature": "StorageStrategy.getFilePermission()", "constructor": false, "full_signature": "@JsonIgnore public FsPermission getFilePermission()", "identifier": "getFilePermission", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "FsPermission", "signature": "FsPermission getFilePermission()", "testcase": false }, { "class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)", "constructor": false, "full_signature": "public Path createPathAndApply(FileSystem fs, Path path)", "identifier": "createPathAndApply", "modifiers": "public", "parameters": "(FileSystem fs, Path path)", "return": "Path", "signature": "Path createPathAndApply(FileSystem fs, Path path)", "testcase": false }, { "class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)", "constructor": false, "full_signature": "public Path createFileAndApply(FileSystem fs, Path file)", "identifier": "createFileAndApply", "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "Path", "signature": "Path createFileAndApply(FileSystem fs, Path file)", "testcase": false }, { "class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)", "constructor": false, "full_signature": "public void applyToFile(FileSystem fs, Path file)", "identifier": "applyToFile", "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "void", "signature": "void applyToFile(FileSystem fs, Path file)", "testcase": false }, { "class_method_signature": "StorageStrategy.validateUmask(String umask)", "constructor": false, "full_signature": "private String validateUmask(String umask)", "identifier": "validateUmask", "modifiers": "private", "parameters": "(String umask)", "return": "String", "signature": "String validateUmask(String umask)", "testcase": false }, { "class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)", "constructor": false, "full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)", "identifier": "getNonExistentLocations", "modifiers": "private", "parameters": "(FileSystem fs, Path path)", "return": "List<Path>", "signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)", "testcase": false }, { "class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "constructor": false, "full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "identifier": "applyStrategy", "modifiers": "private", "parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "return": "void", "signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "testcase": false } ], "superclass": "" }
{ "body": "public Path createPathAndApply(FileSystem fs, Path path) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, path);\n if (locations.isEmpty()) {\n return null;\n }\n fs.mkdirs(path);\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }", "class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)", "constructor": false, "full_signature": "public Path createPathAndApply(FileSystem fs, Path path)", "identifier": "createPathAndApply", "invocations": [ "getNonExistentLocations", "isEmpty", "mkdirs", "applyStrategy", "getFolderPermission", "get", "size" ], "modifiers": "public", "parameters": "(FileSystem fs, Path path)", "return": "Path", "signature": "Path createPathAndApply(FileSystem fs, Path path)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_2
{ "fields": [], "file": "exec/memory/base/src/test/java/org/apache/drill/exec/memory/TestAccountant.java", "identifier": "TestAccountant", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void multiThread() throws InterruptedException {\n final Accountant parent = new Accountant(null, 0, Long.MAX_VALUE);\n\n final int numberOfThreads = 32;\n final int loops = 100;\n Thread[] threads = new Thread[numberOfThreads];\n\n for (int i = 0; i < numberOfThreads; i++) {\n Thread t = new Thread() {\n\n @Override\n public void run() {\n try {\n for (int i = 0; i < loops; i++) {\n ensureAccurateReservations(parent);\n }\n } catch (Exception ex) {\n ex.printStackTrace();\n Assert.fail(ex.getMessage());\n }\n }\n\n };\n threads[i] = t;\n t.start();\n }\n\n for (Thread thread : threads) {\n thread.join();\n }\n\n assertEquals(0, parent.getAllocatedMemory());\n }", "class_method_signature": "TestAccountant.multiThread()", "constructor": false, "full_signature": "@Test public void multiThread()", "identifier": "multiThread", "invocations": [ "ensureAccurateReservations", "printStackTrace", "fail", "getMessage", "start", "join", "assertEquals", "getAllocatedMemory" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void multiThread()", "testcase": true }
{ "fields": [ { "declarator": "parent", "modifier": "protected final", "original_string": "protected final Accountant parent;", "type": "Accountant", "var_name": "parent" }, { "declarator": "reservation", "modifier": "protected final", "original_string": "protected final long reservation;", "type": "long", "var_name": "reservation" }, { "declarator": "peakAllocation = new AtomicLong()", "modifier": "private final", "original_string": "private final AtomicLong peakAllocation = new AtomicLong();", "type": "AtomicLong", "var_name": "peakAllocation" }, { "declarator": "allocationLimit = new AtomicLong()", "modifier": "private final", "original_string": "private final AtomicLong allocationLimit = new AtomicLong();", "type": "AtomicLong", "var_name": "allocationLimit" }, { "declarator": "locallyHeldMemory = new AtomicLong()", "modifier": "private final", "original_string": "private final AtomicLong locallyHeldMemory = new AtomicLong();", "type": "AtomicLong", "var_name": "locallyHeldMemory" } ], "file": "exec/memory/base/src/main/java/org/apache/drill/exec/memory/Accountant.java", "identifier": "Accountant", "interfaces": "implements AutoCloseable", "methods": [ { "class_method_signature": "Accountant.Accountant(Accountant parent, long reservation, long maxAllocation)", "constructor": true, "full_signature": "public Accountant(Accountant parent, long reservation, long maxAllocation)", "identifier": "Accountant", "modifiers": "public", "parameters": "(Accountant parent, long reservation, long maxAllocation)", "return": "", "signature": " Accountant(Accountant parent, long reservation, long maxAllocation)", "testcase": false }, { "class_method_signature": "Accountant.allocateBytes(long size)", "constructor": false, "full_signature": " AllocationOutcome allocateBytes(long size)", "identifier": "allocateBytes", "modifiers": "", "parameters": "(long size)", "return": "AllocationOutcome", "signature": "AllocationOutcome allocateBytes(long size)", "testcase": false }, { "class_method_signature": "Accountant.updatePeak()", "constructor": false, "full_signature": "private void updatePeak()", "identifier": "updatePeak", "modifiers": "private", "parameters": "()", "return": "void", "signature": "void updatePeak()", "testcase": false }, { "class_method_signature": "Accountant.forceAllocate(long size)", "constructor": false, "full_signature": " boolean forceAllocate(long size)", "identifier": "forceAllocate", "modifiers": "", "parameters": "(long size)", "return": "boolean", "signature": "boolean forceAllocate(long size)", "testcase": false }, { "class_method_signature": "Accountant.allocate(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)", "constructor": false, "full_signature": "private AllocationOutcome allocate(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)", "identifier": "allocate", "modifiers": "private", "parameters": "(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)", "return": "AllocationOutcome", "signature": "AllocationOutcome allocate(final long size, final boolean incomingUpdatePeak, final boolean forceAllocation)", "testcase": false }, { "class_method_signature": "Accountant.releaseBytes(long size)", "constructor": false, "full_signature": "public void releaseBytes(long size)", "identifier": "releaseBytes", "modifiers": "public", "parameters": "(long size)", "return": "void", "signature": "void releaseBytes(long size)", "testcase": false }, { "class_method_signature": "Accountant.setLimit(long newLimit)", "constructor": false, "full_signature": "public void setLimit(long newLimit)", "identifier": "setLimit", "modifiers": "public", "parameters": "(long newLimit)", "return": "void", "signature": "void setLimit(long newLimit)", "testcase": false }, { "class_method_signature": "Accountant.isOverLimit()", "constructor": false, "full_signature": "public boolean isOverLimit()", "identifier": "isOverLimit", "modifiers": "public", "parameters": "()", "return": "boolean", "signature": "boolean isOverLimit()", "testcase": false }, { "class_method_signature": "Accountant.close()", "constructor": false, "full_signature": "public void close()", "identifier": "close", "modifiers": "public", "parameters": "()", "return": "void", "signature": "void close()", "testcase": false }, { "class_method_signature": "Accountant.getLimit()", "constructor": false, "full_signature": "public long getLimit()", "identifier": "getLimit", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getLimit()", "testcase": false }, { "class_method_signature": "Accountant.getAllocatedMemory()", "constructor": false, "full_signature": "public long getAllocatedMemory()", "identifier": "getAllocatedMemory", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getAllocatedMemory()", "testcase": false }, { "class_method_signature": "Accountant.getPeakMemoryAllocation()", "constructor": false, "full_signature": "public long getPeakMemoryAllocation()", "identifier": "getPeakMemoryAllocation", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getPeakMemoryAllocation()", "testcase": false } ], "superclass": "" }
{ "body": "public long getAllocatedMemory() {\n return locallyHeldMemory.get();\n }", "class_method_signature": "Accountant.getAllocatedMemory()", "constructor": false, "full_signature": "public long getAllocatedMemory()", "identifier": "getAllocatedMemory", "invocations": [ "get" ], "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getAllocatedMemory()", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_60
{ "fields": [ { "declarator": "built_in = \"built-in\"", "modifier": "private static final", "original_string": "private static final String built_in = \"built-in\";", "type": "String", "var_name": "built_in" }, { "declarator": "udf_jar = \"DrillUDF-1.0.jar\"", "modifier": "private static final", "original_string": "private static final String udf_jar = \"DrillUDF-1.0.jar\";", "type": "String", "var_name": "udf_jar" }, { "declarator": "newJars", "modifier": "private static", "original_string": "private static Map<String, List<FunctionHolder>> newJars;", "type": "Map<String, List<FunctionHolder>>", "var_name": "newJars" }, { "declarator": "registryHolder", "modifier": "private", "original_string": "private FunctionRegistryHolder registryHolder;", "type": "FunctionRegistryHolder", "var_name": "registryHolder" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolderTest.java", "identifier": "FunctionRegistryHolderTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testGetFunctionNamesByJar() {\n ArrayList<String> expectedResult = Lists.newArrayList();\n for (FunctionHolder functionHolder : newJars.get(built_in)) {\n expectedResult.add(functionHolder.getName());\n }\n compareTwoLists(expectedResult, registryHolder.getFunctionNamesByJar(built_in));\n }", "class_method_signature": "FunctionRegistryHolderTest.testGetFunctionNamesByJar()", "constructor": false, "full_signature": "@Test public void testGetFunctionNamesByJar()", "identifier": "testGetFunctionNamesByJar", "invocations": [ "newArrayList", "get", "add", "getName", "compareTwoLists", "getFunctionNamesByJar" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testGetFunctionNamesByJar()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(FunctionRegistryHolder.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "readWriteLock = new ReentrantReadWriteLock()", "modifier": "private final", "original_string": "private final ReadWriteLock readWriteLock = new ReentrantReadWriteLock();", "type": "ReadWriteLock", "var_name": "readWriteLock" }, { "declarator": "readLock = new AutoCloseableLock(readWriteLock.readLock())", "modifier": "private final", "original_string": "private final AutoCloseableLock readLock = new AutoCloseableLock(readWriteLock.readLock());", "type": "AutoCloseableLock", "var_name": "readLock" }, { "declarator": "writeLock = new AutoCloseableLock(readWriteLock.writeLock())", "modifier": "private final", "original_string": "private final AutoCloseableLock writeLock = new AutoCloseableLock(readWriteLock.writeLock());", "type": "AutoCloseableLock", "var_name": "writeLock" }, { "declarator": "version", "modifier": "private", "original_string": "private long version;", "type": "long", "var_name": "version" }, { "declarator": "jars", "modifier": "private final", "original_string": "private final Map<String, Map<String, Queue<String>>> jars;", "type": "Map<String, Map<String, Queue<String>>>", "var_name": "jars" }, { "declarator": "functions", "modifier": "private final", "original_string": "private final Map<String, Map<String, DrillFuncHolder>> functions;", "type": "Map<String, Map<String, DrillFuncHolder>>", "var_name": "functions" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/expr/fn/registry/FunctionRegistryHolder.java", "identifier": "FunctionRegistryHolder", "interfaces": "", "methods": [ { "class_method_signature": "FunctionRegistryHolder.FunctionRegistryHolder()", "constructor": true, "full_signature": "public FunctionRegistryHolder()", "identifier": "FunctionRegistryHolder", "modifiers": "public", "parameters": "()", "return": "", "signature": " FunctionRegistryHolder()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getVersion()", "constructor": false, "full_signature": "public long getVersion()", "identifier": "getVersion", "modifiers": "public", "parameters": "()", "return": "long", "signature": "long getVersion()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.addJars(Map<String, List<FunctionHolder>> newJars, long version)", "constructor": false, "full_signature": "public void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "identifier": "addJars", "modifiers": "public", "parameters": "(Map<String, List<FunctionHolder>> newJars, long version)", "return": "void", "signature": "void addJars(Map<String, List<FunctionHolder>> newJars, long version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.removeJar(String jarName)", "constructor": false, "full_signature": "public void removeJar(String jarName)", "identifier": "removeJar", "modifiers": "public", "parameters": "(String jarName)", "return": "void", "signature": "void removeJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllJarNames()", "constructor": false, "full_signature": "public List<String> getAllJarNames()", "identifier": "getAllJarNames", "modifiers": "public", "parameters": "()", "return": "List<String>", "signature": "List<String> getAllJarNames()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)", "constructor": false, "full_signature": "public List<String> getFunctionNamesByJar(String jarName)", "identifier": "getFunctionNamesByJar", "modifiers": "public", "parameters": "(String jarName)", "return": "List<String>", "signature": "List<String> getFunctionNamesByJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders(AtomicLong version)", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "identifier": "getAllFunctionsWithHolders", "modifiers": "public", "parameters": "(AtomicLong version)", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders(AtomicLong version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithHolders()", "constructor": false, "full_signature": "public ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()", "identifier": "getAllFunctionsWithHolders", "modifiers": "public", "parameters": "()", "return": "ListMultimap<String, DrillFuncHolder>", "signature": "ListMultimap<String, DrillFuncHolder> getAllFunctionsWithHolders()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getAllFunctionsWithSignatures()", "constructor": false, "full_signature": "public ListMultimap<String, String> getAllFunctionsWithSignatures()", "identifier": "getAllFunctionsWithSignatures", "modifiers": "public", "parameters": "()", "return": "ListMultimap<String, String>", "signature": "ListMultimap<String, String> getAllFunctionsWithSignatures()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName, AtomicLong version)", "constructor": false, "full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)", "identifier": "getHoldersByFunctionName", "modifiers": "public", "parameters": "(String functionName, AtomicLong version)", "return": "List<DrillFuncHolder>", "signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName, AtomicLong version)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getHoldersByFunctionName(String functionName)", "constructor": false, "full_signature": "public List<DrillFuncHolder> getHoldersByFunctionName(String functionName)", "identifier": "getHoldersByFunctionName", "modifiers": "public", "parameters": "(String functionName)", "return": "List<DrillFuncHolder>", "signature": "List<DrillFuncHolder> getHoldersByFunctionName(String functionName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.containsJar(String jarName)", "constructor": false, "full_signature": "public boolean containsJar(String jarName)", "identifier": "containsJar", "modifiers": "public", "parameters": "(String jarName)", "return": "boolean", "signature": "boolean containsJar(String jarName)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.functionsSize()", "constructor": false, "full_signature": "public int functionsSize()", "identifier": "functionsSize", "modifiers": "public", "parameters": "()", "return": "int", "signature": "int functionsSize()", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.getJarNameByFunctionSignature(String functionName, String functionSignature)", "constructor": false, "full_signature": "public String getJarNameByFunctionSignature(String functionName, String functionSignature)", "identifier": "getJarNameByFunctionSignature", "modifiers": "public", "parameters": "(String functionName, String functionSignature)", "return": "String", "signature": "String getJarNameByFunctionSignature(String functionName, String functionSignature)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "constructor": false, "full_signature": "private void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "identifier": "addFunctions", "modifiers": "private", "parameters": "(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "return": "void", "signature": "void addFunctions(Map<String, Queue<String>> jar, List<FunctionHolder> newFunctions)", "testcase": false }, { "class_method_signature": "FunctionRegistryHolder.removeAllByJar(String jarName)", "constructor": false, "full_signature": "private void removeAllByJar(String jarName)", "identifier": "removeAllByJar", "modifiers": "private", "parameters": "(String jarName)", "return": "void", "signature": "void removeAllByJar(String jarName)", "testcase": false } ], "superclass": "" }
{ "body": "public List<String> getFunctionNamesByJar(String jarName) {\n try (AutoCloseableLock lock = readLock.open()){\n Map<String, Queue<String>> functions = jars.get(jarName);\n return functions == null ? Lists.<String>newArrayList() : Lists.newArrayList(functions.keySet());\n }\n }", "class_method_signature": "FunctionRegistryHolder.getFunctionNamesByJar(String jarName)", "constructor": false, "full_signature": "public List<String> getFunctionNamesByJar(String jarName)", "identifier": "getFunctionNamesByJar", "invocations": [ "open", "get", "newArrayList", "newArrayList", "keySet" ], "modifiers": "public", "parameters": "(String jarName)", "return": "List<String>", "signature": "List<String> getFunctionNamesByJar(String jarName)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_37
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/DrillFileSystemUtilTest.java", "identifier": "DrillFileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListDirectoriesRecursiveWithFilter() throws IOException {\n List<FileStatus> statuses = DrillFileSystemUtil.listDirectories(fs, base, true, new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return path.getName().endsWith(\"a\");\n }\n });\n assertEquals(\"Directory count should match\", 2, statuses.size());\n\n Collections.sort(statuses);\n assertEquals(\"Directory name should match\", \"a\", statuses.get(0).getPath().getName());\n assertEquals(\"Directory name should match\", \"aa\", statuses.get(1).getPath().getName());\n }", "class_method_signature": "DrillFileSystemUtilTest.testListDirectoriesRecursiveWithFilter()", "constructor": false, "full_signature": "@Test public void testListDirectoriesRecursiveWithFilter()", "identifier": "testListDirectoriesRecursiveWithFilter", "invocations": [ "listDirectories", "endsWith", "getName", "assertEquals", "size", "sort", "assertEquals", "getName", "getPath", "get", "assertEquals", "getName", "getPath", "get" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListDirectoriesRecursiveWithFilter()", "testcase": true }
{ "fields": [ { "declarator": "DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DRILL_SYSTEM_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return !path.getName().startsWith(DrillFileSystem.UNDERSCORE_PREFIX) && !path.getName().startsWith(DrillFileSystem.DOT_PREFIX);\n }\n };", "type": "PathFilter", "var_name": "DRILL_SYSTEM_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/DrillFileSystemUtil.java", "identifier": "DrillFileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "DrillFileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n return FileSystemUtil.listDirectories(fs, path, recursive, FileSystemUtil.mergeFilters(DRILL_SYSTEM_FILTER, filters));\n }", "class_method_signature": "DrillFileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "invocations": [ "listDirectories", "mergeFilters" ], "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_21
{ "fields": [], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/util/FileSystemUtilTest.java", "identifier": "FileSystemUtilTest", "interfaces": "", "superclass": "extends FileSystemUtilTestBase" }
{ "body": "@Test\n public void testListFilesWithoutFilter() throws IOException {\n List<FileStatus> statuses = FileSystemUtil.listFiles(fs, new Path(base, \"a\"), false);\n assertEquals(\"File count should match\", 3, statuses.size());\n }", "class_method_signature": "FileSystemUtilTest.testListFilesWithoutFilter()", "constructor": false, "full_signature": "@Test public void testListFilesWithoutFilter()", "identifier": "testListFilesWithoutFilter", "invocations": [ "listFiles", "assertEquals", "size" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testListFilesWithoutFilter()", "testcase": true }
{ "fields": [ { "declarator": "DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n }", "modifier": "public static final", "original_string": "public static final PathFilter DUMMY_FILTER = new PathFilter() {\n @Override\n public boolean accept(Path path) {\n return true;\n }\n };", "type": "PathFilter", "var_name": "DUMMY_FILTER" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/util/FileSystemUtil.java", "identifier": "FileSystemUtil", "interfaces": "", "methods": [ { "class_method_signature": "FileSystemUtil.listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listDirectories", "modifiers": "public static", "parameters": "(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(final FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listAll", "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(PathFilter filter, PathFilter[] filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(PathFilter filter, PathFilter[] filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(PathFilter filter, PathFilter[] filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.mergeFilters(final PathFilter... filters)", "constructor": false, "full_signature": "public static PathFilter mergeFilters(final PathFilter... filters)", "identifier": "mergeFilters", "modifiers": "public static", "parameters": "(final PathFilter... filters)", "return": "PathFilter", "signature": "PathFilter mergeFilters(final PathFilter... filters)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listDirectories", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listDirectories(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listFiles", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false }, { "class_method_signature": "FileSystemUtil.listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "constructor": false, "full_signature": "private static List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "identifier": "listAll", "modifiers": "private static", "parameters": "(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "return": "List<FileStatus>", "signature": "List<FileStatus> listAll(FileSystem fs, Path path, boolean recursive, List<FileStatus> statuses, PathFilter filter)", "testcase": false } ], "superclass": "" }
{ "body": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters) throws IOException {\n List<FileStatus> statuses = new ArrayList<>();\n listFiles(fs, path, recursive, statuses, mergeFilters(filters));\n return statuses;\n }", "class_method_signature": "FileSystemUtil.listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "constructor": false, "full_signature": "public static List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "identifier": "listFiles", "invocations": [ "listFiles", "mergeFilters" ], "modifiers": "public static", "parameters": "(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "return": "List<FileStatus>", "signature": "List<FileStatus> listFiles(FileSystem fs, Path path, boolean recursive, PathFilter... filters)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_76
{ "fields": [ { "declarator": "writer", "modifier": "private static", "original_string": "private static VectorContainerWriter writer;", "type": "VectorContainerWriter", "var_name": "writer" }, { "declarator": "mutator", "modifier": "private static", "original_string": "private static TestOutputMutator mutator;", "type": "TestOutputMutator", "var_name": "mutator" }, { "declarator": "bsonReader", "modifier": "private static", "original_string": "private static BsonRecordReader bsonReader;", "type": "BsonRecordReader", "var_name": "bsonReader" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/bson/TestBsonRecordReader.java", "identifier": "TestBsonRecordReader", "interfaces": "", "superclass": "extends BaseTestQuery" }
{ "body": "@Test\n public void testTimeStampType() throws IOException {\n BsonDocument bsonDoc = new BsonDocument();\n bsonDoc.append(\"ts\", new BsonTimestamp(1000, 10));\n writer.reset();\n bsonReader.write(writer, new BsonDocumentReader(bsonDoc));\n SingleMapReaderImpl mapReader = (SingleMapReaderImpl) writer.getMapVector().getReader();\n assertEquals(1000l, mapReader.reader(\"ts\").readDateTime().getMillis());\n }", "class_method_signature": "TestBsonRecordReader.testTimeStampType()", "constructor": false, "full_signature": "@Test public void testTimeStampType()", "identifier": "testTimeStampType", "invocations": [ "append", "reset", "write", "getReader", "getMapVector", "assertEquals", "getMillis", "readDateTime", "reader" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testTimeStampType()", "testcase": true }
{ "fields": [ { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class)", "modifier": "static final", "original_string": "static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(BsonRecordReader.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "MAX_RECORD_SIZE = 128 * 1024", "modifier": "public final static", "original_string": "public final static int MAX_RECORD_SIZE = 128 * 1024;", "type": "int", "var_name": "MAX_RECORD_SIZE" }, { "declarator": "columns", "modifier": "private final", "original_string": "private final List<SchemaPath> columns;", "type": "List<SchemaPath>", "var_name": "columns" }, { "declarator": "atLeastOneWrite = false", "modifier": "private", "original_string": "private boolean atLeastOneWrite = false;", "type": "boolean", "var_name": "atLeastOneWrite" }, { "declarator": "readNumbersAsDouble", "modifier": "private final", "original_string": "private final boolean readNumbersAsDouble;", "type": "boolean", "var_name": "readNumbersAsDouble" }, { "declarator": "workBuf", "modifier": "protected", "original_string": "protected DrillBuf workBuf;", "type": "DrillBuf", "var_name": "workBuf" }, { "declarator": "currentFieldName", "modifier": "private", "original_string": "private String currentFieldName;", "type": "String", "var_name": "currentFieldName" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/bson/BsonRecordReader.java", "identifier": "BsonRecordReader", "interfaces": "", "methods": [ { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, boolean allTextMode, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "constructor": true, "full_signature": "public BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "identifier": "BsonRecordReader", "modifiers": "public", "parameters": "(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "return": "", "signature": " BsonRecordReader(DrillBuf managedBuf, List<SchemaPath> columns, boolean readNumbersAsDouble)", "testcase": false }, { "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "constructor": false, "full_signature": "private void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "identifier": "writeToListOrMap", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "return": "void", "signature": "void writeToListOrMap(BsonReader reader, final MapOrListWriterImpl writer, boolean isList, String fieldName)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBinary(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeTimeStamp", "modifiers": "private", "parameters": "(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeTimeStamp(int timestamp, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeString", "modifiers": "private", "parameters": "(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeString(String readString, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeObjectId", "modifiers": "private", "parameters": "(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeObjectId(BsonReader reader, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDouble", "modifiers": "private", "parameters": "(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDouble(double readDouble, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeDateTime", "modifiers": "private", "parameters": "(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeDateTime(long readDateTime, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeBoolean", "modifiers": "private", "parameters": "(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeBoolean(boolean readBoolean, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "constructor": false, "full_signature": "private void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "identifier": "writeBinary", "modifiers": "private", "parameters": "(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "return": "void", "signature": "void writeBinary(final MapOrListWriterImpl writer, String fieldName, boolean isList,\n final VarBinaryHolder vb, final byte[] bytes)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt64", "modifiers": "private", "parameters": "(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt64(long readInt64, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "constructor": false, "full_signature": "private void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "identifier": "writeInt32", "modifiers": "private", "parameters": "(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "return": "void", "signature": "void writeInt32(int readInt32, final MapOrListWriterImpl writer, String fieldName, boolean isList)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensureAtLeastOneField(ComplexWriter writer)", "constructor": false, "full_signature": "public void ensureAtLeastOneField(ComplexWriter writer)", "identifier": "ensureAtLeastOneField", "modifiers": "public", "parameters": "(ComplexWriter writer)", "return": "void", "signature": "void ensureAtLeastOneField(ComplexWriter writer)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(UserException.Builder exceptionBuilder, String field,\n String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "constructor": false, "full_signature": "public UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "identifier": "getExceptionWithContext", "modifiers": "public", "parameters": "(Throwable exception, String field, String msg, Object... args)", "return": "UserException.Builder", "signature": "UserException.Builder getExceptionWithContext(Throwable exception, String field, String msg, Object... args)", "testcase": false }, { "class_method_signature": "BsonRecordReader.ensure(final int length)", "constructor": false, "full_signature": "private void ensure(final int length)", "identifier": "ensure", "modifiers": "private", "parameters": "(final int length)", "return": "void", "signature": "void ensure(final int length)", "testcase": false } ], "superclass": "" }
{ "body": "public void write(ComplexWriter writer, BsonReader reader) throws IOException {\n reader.readStartDocument();\n BsonType readBsonType = reader.getCurrentBsonType();\n switch (readBsonType) {\n case DOCUMENT:\n writeToListOrMap(reader, new MapOrListWriterImpl(writer.rootAsMap()), false, null);\n break;\n default:\n throw new DrillRuntimeException(\"Root object must be DOCUMENT type. Found: \" + readBsonType);\n }\n }", "class_method_signature": "BsonRecordReader.write(ComplexWriter writer, BsonReader reader)", "constructor": false, "full_signature": "public void write(ComplexWriter writer, BsonReader reader)", "identifier": "write", "invocations": [ "readStartDocument", "getCurrentBsonType", "writeToListOrMap", "rootAsMap" ], "modifiers": "public", "parameters": "(ComplexWriter writer, BsonReader reader)", "return": "void", "signature": "void write(ComplexWriter writer, BsonReader reader)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }
124004218_92
{ "fields": [ { "declarator": "FULL_PERMISSION = FsPermission.getDirDefault()", "modifier": "private static final", "original_string": "private static final FsPermission FULL_PERMISSION = FsPermission.getDirDefault();", "type": "FsPermission", "var_name": "FULL_PERMISSION" }, { "declarator": "PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false)", "modifier": "private static final", "original_string": "private static final StorageStrategy PERSISTENT_STRATEGY = new StorageStrategy(\"002\", false);", "type": "StorageStrategy", "var_name": "PERSISTENT_STRATEGY" }, { "declarator": "TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true)", "modifier": "private static final", "original_string": "private static final StorageStrategy TEMPORARY_STRATEGY = new StorageStrategy(\"077\", true);", "type": "StorageStrategy", "var_name": "TEMPORARY_STRATEGY" }, { "declarator": "fs", "modifier": "private static", "original_string": "private static FileSystem fs;", "type": "FileSystem", "var_name": "fs" } ], "file": "exec/java-exec/src/test/java/org/apache/drill/exec/store/StorageStrategyTest.java", "identifier": "StorageStrategyTest", "interfaces": "", "superclass": "" }
{ "body": "@Test\n public void testPermissionAndDeleteOnExitTrueForFileOnly() throws Exception {\n Path initialPath = prepareStorageDirectory();\n Path file = addNLevelsAndFile(initialPath, 0, true);\n\n Path createdFile = TEMPORARY_STRATEGY.createFileAndApply(fs, file);\n\n assertEquals(\"Path should match\", file, createdFile);\n checkPathAndPermission(initialPath, file, true, 0, TEMPORARY_STRATEGY);\n checkDeleteOnExit(file, true);\n }", "class_method_signature": "StorageStrategyTest.testPermissionAndDeleteOnExitTrueForFileOnly()", "constructor": false, "full_signature": "@Test public void testPermissionAndDeleteOnExitTrueForFileOnly()", "identifier": "testPermissionAndDeleteOnExitTrueForFileOnly", "invocations": [ "prepareStorageDirectory", "addNLevelsAndFile", "createFileAndApply", "assertEquals", "checkPathAndPermission", "checkDeleteOnExit" ], "modifiers": "@Test public", "parameters": "()", "return": "void", "signature": "void testPermissionAndDeleteOnExitTrueForFileOnly()", "testcase": true }
{ "fields": [ { "declarator": "DEFAULT = new StorageStrategy(\"002\", false)", "modifier": "public static final", "original_string": "public static final StorageStrategy DEFAULT = new StorageStrategy(\"002\", false);", "type": "StorageStrategy", "var_name": "DEFAULT" }, { "declarator": "TEMPORARY = new StorageStrategy(\"077\", true)", "modifier": "public static final", "original_string": "public static final StorageStrategy TEMPORARY = new StorageStrategy(\"077\", true);", "type": "StorageStrategy", "var_name": "TEMPORARY" }, { "declarator": "logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class)", "modifier": "private static final", "original_string": "private static final org.slf4j.Logger logger = org.slf4j.LoggerFactory.getLogger(StorageStrategy.class);", "type": "org.slf4j.Logger", "var_name": "logger" }, { "declarator": "umask", "modifier": "private final", "original_string": "private final String umask;", "type": "String", "var_name": "umask" }, { "declarator": "deleteOnExit", "modifier": "private final", "original_string": "private final boolean deleteOnExit;", "type": "boolean", "var_name": "deleteOnExit" } ], "file": "exec/java-exec/src/main/java/org/apache/drill/exec/store/StorageStrategy.java", "identifier": "StorageStrategy", "interfaces": "", "methods": [ { "class_method_signature": "StorageStrategy.StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "constructor": true, "full_signature": "@JsonCreator public StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "identifier": "StorageStrategy", "modifiers": "@JsonCreator public", "parameters": "(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "return": "", "signature": " StorageStrategy(@JsonProperty(\"umask\") String umask,\n @JsonProperty(\"deleteOnExit\") boolean deleteOnExit)", "testcase": false }, { "class_method_signature": "StorageStrategy.getUmask()", "constructor": false, "full_signature": "public String getUmask()", "identifier": "getUmask", "modifiers": "public", "parameters": "()", "return": "String", "signature": "String getUmask()", "testcase": false }, { "class_method_signature": "StorageStrategy.isDeleteOnExit()", "constructor": false, "full_signature": "public boolean isDeleteOnExit()", "identifier": "isDeleteOnExit", "modifiers": "public", "parameters": "()", "return": "boolean", "signature": "boolean isDeleteOnExit()", "testcase": false }, { "class_method_signature": "StorageStrategy.getFolderPermission()", "constructor": false, "full_signature": "@JsonIgnore public FsPermission getFolderPermission()", "identifier": "getFolderPermission", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "FsPermission", "signature": "FsPermission getFolderPermission()", "testcase": false }, { "class_method_signature": "StorageStrategy.getFilePermission()", "constructor": false, "full_signature": "@JsonIgnore public FsPermission getFilePermission()", "identifier": "getFilePermission", "modifiers": "@JsonIgnore public", "parameters": "()", "return": "FsPermission", "signature": "FsPermission getFilePermission()", "testcase": false }, { "class_method_signature": "StorageStrategy.createPathAndApply(FileSystem fs, Path path)", "constructor": false, "full_signature": "public Path createPathAndApply(FileSystem fs, Path path)", "identifier": "createPathAndApply", "modifiers": "public", "parameters": "(FileSystem fs, Path path)", "return": "Path", "signature": "Path createPathAndApply(FileSystem fs, Path path)", "testcase": false }, { "class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)", "constructor": false, "full_signature": "public Path createFileAndApply(FileSystem fs, Path file)", "identifier": "createFileAndApply", "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "Path", "signature": "Path createFileAndApply(FileSystem fs, Path file)", "testcase": false }, { "class_method_signature": "StorageStrategy.applyToFile(FileSystem fs, Path file)", "constructor": false, "full_signature": "public void applyToFile(FileSystem fs, Path file)", "identifier": "applyToFile", "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "void", "signature": "void applyToFile(FileSystem fs, Path file)", "testcase": false }, { "class_method_signature": "StorageStrategy.validateUmask(String umask)", "constructor": false, "full_signature": "private String validateUmask(String umask)", "identifier": "validateUmask", "modifiers": "private", "parameters": "(String umask)", "return": "String", "signature": "String validateUmask(String umask)", "testcase": false }, { "class_method_signature": "StorageStrategy.getNonExistentLocations(FileSystem fs, Path path)", "constructor": false, "full_signature": "private List<Path> getNonExistentLocations(FileSystem fs, Path path)", "identifier": "getNonExistentLocations", "modifiers": "private", "parameters": "(FileSystem fs, Path path)", "return": "List<Path>", "signature": "List<Path> getNonExistentLocations(FileSystem fs, Path path)", "testcase": false }, { "class_method_signature": "StorageStrategy.applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "constructor": false, "full_signature": "private void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "identifier": "applyStrategy", "modifiers": "private", "parameters": "(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "return": "void", "signature": "void applyStrategy(FileSystem fs, Path path, FsPermission permission, boolean deleteOnExit)", "testcase": false } ], "superclass": "" }
{ "body": "public Path createFileAndApply(FileSystem fs, Path file) throws IOException {\n List<Path> locations = getNonExistentLocations(fs, file.getParent());\n if (!fs.createNewFile(file)) {\n throw new IOException(String.format(\"File [%s] already exists on file system [%s].\",\n file.toUri().getPath(), fs.getUri()));\n }\n applyToFile(fs, file);\n\n if (locations.isEmpty()) {\n return file;\n }\n\n for (Path location : locations) {\n applyStrategy(fs, location, getFolderPermission(), deleteOnExit);\n }\n return locations.get(locations.size() - 1);\n }", "class_method_signature": "StorageStrategy.createFileAndApply(FileSystem fs, Path file)", "constructor": false, "full_signature": "public Path createFileAndApply(FileSystem fs, Path file)", "identifier": "createFileAndApply", "invocations": [ "getNonExistentLocations", "getParent", "createNewFile", "format", "getPath", "toUri", "getUri", "applyToFile", "isEmpty", "applyStrategy", "getFolderPermission", "get", "size" ], "modifiers": "public", "parameters": "(FileSystem fs, Path file)", "return": "Path", "signature": "Path createFileAndApply(FileSystem fs, Path file)", "testcase": false }
{ "created": null, "fork": null, "fork_count": 0, "is_fork": false, "language": "Java", "license": "licensed", "repo_id": 124004218, "size": 6036, "stargazer_count": 12, "stars": null, "updates": null, "url": "https://github.com/zpochen/drill" }