{"id":20207779,"url":"https://github.com/exasol/java-class-list-extractor","last_synced_at":"2025-10-19T03:35:26.796Z","repository":{"id":43014279,"uuid":"466134726","full_name":"exasol/java-class-list-extractor","owner":"exasol","description":"Tool for extracting a list of loaded classes from UDFs","archived":false,"fork":false,"pushed_at":"2024-06-14T15:55:28.000Z","size":131,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-01-13T21:09:24.277Z","etag":null,"topics":["deployment","exasol-integration","udf"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exasol.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-03-04T13:31:40.000Z","updated_at":"2024-05-08T13:17:31.000Z","dependencies_parsed_at":"2024-05-08T10:27:37.931Z","dependency_job_id":"1e848a52-499a-4483-9348-9901acc2cf84","html_url":"https://github.com/exasol/java-class-list-extractor","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Fjava-class-list-extractor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Fjava-class-list-extractor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Fjava-class-list-extractor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exasol%2Fjava-class-list-extractor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exasol","download_url":"https://codeload.github.com/exasol/java-class-list-extractor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241644559,"owners_count":19996179,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deployment","exasol-integration","udf"],"created_at":"2024-11-14T05:32:06.315Z","updated_at":"2025-10-19T03:35:26.775Z","avatar_url":"https://github.com/exasol.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Java Class List Extractor\n\n## ⚠️ This project is deprecated and no longer maintained ⚠️\n\n[![Build Status](https://github.com/exasol/java-class-list-extractor/actions/workflows/ci-build.yml/badge.svg)](https://github.com/exasol/java-class-list-extractor/actions/workflows/ci-build.yml)\n[![Maven Central \u0026ndash; Class list verifier](https://img.shields.io/maven-central/v/com.exasol/java-class-list-verifier)](https://search.maven.org/artifact/com.exasol/java-class-list-verifier)\n\n[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n\n[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n[![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n\n[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=com.exasol%3Ajava-class-list-extractor-aggregator\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=com.exasol%3Ajava-class-list-extractor-aggregator)\n\nThe Java Class List Extractor is a tool that helps you to capture a list of loaded classed from Java UDFs / AdapterScripts in an Exasol database. The class list is required for improving the start-up performance of Java UDF using [java-udf-startup-time-improver](https://github.com/exasol/java-udf-startup-time-improver/).\n\nThis tool consists of two parts:\n\n* The `ClassListExtractor`\n* The `ClassListVerifier`\n\nThe extractor captures the class list of a UDF run. The verifier checks that this class list is embedded into the JAR archive of the application. If it's not it breaks the build and writes the expected class list to `target/expeced-classes.lst`. From there you can copy it to your resources and restart the build.\n\n## What to Optimize for\n\nThe class list determines which classes will be preloaded. This can reduce the start-up time of the JVM. However, if you preload many classes that are not used at runtime that's an overhead. So you should make a conscious decision which test cases you want to analyze. Analyzing all test-cases (including lots of tests for unlikely edge cases) gives a non-ideal result.\n\n## Usage\n\n* Add this project as maven test dependency.\n* Create a ClassListExtractor:\n    ```java\n    final ClassListExtractor extractor = new ClassListExtractor(EXASOL.getDefaultBucket(), port -\u003e new InetSocketAddress(EXASOL.getHostIp() + \"\", port));\n    ```\n* Make sure that you close the extractor. For example in `afterAll()` if you created it in `beforeAll()`:\n  ```java\n  @AfterAll\n  static void afterAll() throws SQLException {\n    statement.close();\n    connection.close();\n    extractor.close();\n  }\n  ```\n* Add the JVM options provided by `extractor.getJvmOptions()` to your UDF or Adapter Script definitions.\n\n  If you use the [test-db-builder-java](https://github.com/exasol/test-db-builder-java), you can use the following snippet:\n  ```java\n  final ExasolObjectFactory objectFactory = new ExasolObjectFactory(connection,\n     ExasolObjectConfiguration.builder().withJvmOptions(extractor.getJvmOptions()).build());\n  ```\n  If you also use [udf-debugging-java](https://github.com/exasol/udf-debugging-java/), use:\n  ```java\n  final List\u003cString\u003e jvmOptions = new ArrayList\u003c\u003e(Arrays.asList(udfTestSetup.getJvmOptions()));\n  jvmOptions.addAll(Arrays.asList(extractor.getJvmOptions()));\n  final ExasolObjectFactory objectFactory = new ExasolObjectFactory(connection,\n         ExasolObjectConfiguration.builder().withJvmOptions(jvmOptions.toArray(String[]::new)).build());\n  ```\n* Run the queries you want to optimize inside of `extractor.capture()`:\n  ```java\n  final List\u003cString\u003e classList = extractor.capture(() -\u003e {\n     try (final ResultSet result = statement.executeQuery(\"SELECT TEST.MY_UDF() AS RES\")) {\n       result.next();\n       assertThat(result.getString(\"RES\"), equalTo(\"Hello Java World!\"));\n     }\n  });\n  ```\n* Add the verifier:\n  ```java\n  new ClassListVerifier()\n    .verifyClassListFile(classList, Path.of(\"target/my-app.jar\"));\n  ```\n\nIf you've multiple queries that you want to optimize for, you can either run all of them in the same `capture()` or run `capture()` multiple times. In the second case you have to take care for merging the generated class lists. We recommend using a `Set` for that task. That makes sure that there are no duplicate entries.\n\n## Additional Information\n\n* [Changelog](doc/changes/changelog.md)\n* [Dependencies](dependencies.md)\n* [Requirements](doc/requirements.md)\n* [Design](doc/design.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexasol%2Fjava-class-list-extractor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexasol%2Fjava-class-list-extractor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexasol%2Fjava-class-list-extractor/lists"}