Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#2730] Split Iceberg REST service #4005

Merged
merged 11 commits into from
Jul 23, 2024
Merged

[#2730] Split Iceberg REST service #4005

merged 11 commits into from
Jul 23, 2024

Conversation

FANNG1
Copy link
Contributor

@FANNG1 FANNG1 commented Jun 28, 2024

What changes were proposed in this pull request?

Split IcebergRESTService into one separate module, it could be managed with or without Gravitino server.

For user

  1. provide an isolated Iceberg REST server package or Gravitino package with directory iceberg-rest-server which contains Iceberg REST server. They both contain isolated config files and start&stop script.
  2. The configuration items start with gravitino.iceberg-rest. are treated as Iceberg REST server configs. like gravitino.iceberg-rest.catalog-backend, gravitino.iceberg-rest.httpPort, etc. Configurations for Iceberg REST server are same in isolated package and Gravitino package.

For developer

The core is RESTService which start JettyServer for Iceberg REST server,

  • For isolated Iceberg REST server module, the entrypoint is IcebergRESTServer which provides configuration, metricsSystem for RESTService.
  • For GravitinoServer, RESTService is managed as a AuxiliaryService.

Why are the changes needed?

Iceberg rest service is managed as an auxiliary service in Gravitino server , for the users who want to use Iceberg REST service only, it introduces an extra burden.

Fix: #2730

Does this PR introduce any user-facing change?

yes, will add document in #4113

How was this patch tested?

  1. existing tests
  2. test in local env as a Iceberg REST server

related docs

https://docs.google.com/document/d/1lyJwMaaJKfMqtnH9c7LwvnOHRKm7gh8Al4Sw3T1DFjM/edit

@FANNG1 FANNG1 force-pushed the split branch 10 times, most recently from 843e9f4 to 8402bec Compare July 2, 2024 10:17
@FANNG1 FANNG1 closed this Jul 3, 2024
@FANNG1 FANNG1 reopened this Jul 3, 2024
@FANNG1 FANNG1 force-pushed the split branch 6 times, most recently from 8a3624b to 91f9938 Compare July 3, 2024 08:02
@lmccay
Copy link

lmccay commented Jul 3, 2024

@FANNG1 - I am interested in this change and would like to read some background on it. Is there a [email protected] thread to DISCUSS such a large change? A design doc or proposal in wiki? Can you update the PR template with some details of what this is doing and why?

@FANNG1
Copy link
Contributor Author

FANNG1 commented Jul 3, 2024

@FANNG1 - I am interested in this change and would like to read some background on it. Is there a [email protected] thread to DISCUSS such a large change? A design doc or proposal in wiki? Can you update the PR template with some details of what this is doing and why?

Hi, @lmccay , I have updated the doc in the PR template, you could refer to it.


JAVA_OPTS+=" -Dfile.encoding=UTF-8"
JAVA_OPTS+=" -Dlog4j2.configurationFile=file://${GRAVITINO_CONF_DIR}/log4j2.properties"
JAVA_OPTS+=" -Dgravitino.log.path=${GRAVITINO_LOG_DIR} ${GRAVITINO_MEM}"
JAVA_OPTS+=" -Dgravitino.server.name=${GRAVITINO_SIMPLE_SERVER_NAME}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used to specify log file name

@FANNG1 FANNG1 changed the title [SIP] Split Iceberg REST service [#2730] Split Iceberg REST service Jul 5, 2024
@FANNG1 FANNG1 marked this pull request as draft July 5, 2024 08:46
@FANNG1 FANNG1 force-pushed the split branch 3 times, most recently from c079c5e to f4e6969 Compare July 19, 2024 08:14
@FANNG1
Copy link
Contributor Author

FANNG1 commented Jul 19, 2024

@jerryshao , all comments are addressed, please help to review again.

@FANNG1 FANNG1 force-pushed the split branch 2 times, most recently from 4a0a796 to 10de2c9 Compare July 19, 2024 10:34
bin/gravitino-iceberg-rest-server.sh Outdated Show resolved Hide resolved
eventListenerManager.init(
config.getConfigsWithPrefix(EventListenerManager.GRAVITINO_EVENT_LISTENER_PREFIX));
this.eventBus = eventListenerManager.createEventBus();
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would think that access control manager is also needed for the Iceberg rest server. But it requires many refactorings, we can do it later.

Copy link
Contributor Author

@FANNG1 FANNG1 Jul 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, this is the next phase for Iceberg REST service.

implementation(libs.bundles.jersey)
implementation(libs.bundles.jetty)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this blank line.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

this.accessControlManager = new AccessControlManager(entityStore, idGenerator, config);
} else {
this.accessControlManager = null;
initBaseComponent();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"initBaseComponents" and "initGravitinoServerComponents"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

name ->
config.getAllConfig().forEach((k, v) -> extractConfig(serviceConfigs, name, k, v)));
return serviceConfigs;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should:

  1. Update the server config doc to describe the new config names and declare that old keys are still workable.
  2. Here in the code, when old configs are configured, output a warn log to users.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. will use separate PR to add document
  2. done

"test4",
"b.test2",
"test2"),
serviceConfigs);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If old and new configs are both set, who will take precedence, who will overwrite who? I think you need to clarify this behavior and add UT to cover this scenario.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will throw exception and add UT for it

Copy link
Contributor

@jerryshao jerryshao Jul 23, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should honor overwrite mechanism, not throw an exception, I think throwing an exception is too severe, just adding warning logs and using new to overwrite old should be enough, what do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, updated

@FANNG1
Copy link
Contributor Author

FANNG1 commented Jul 23, 2024

@jerryshao , all comments are addressed, please help to review again

@jerryshao jerryshao merged commit 2353a87 into apache:main Jul 23, 2024
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Subtask] Deploy the iceberg rest service separately from the gravitino service
4 participants