-
Notifications
You must be signed in to change notification settings - Fork 988
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add AlertDatabase request and response, and remove ignoreIfExists in …
…CreateDatabaseReques fix RESTCatalog fix checkstyle fail fix error change in RESTCatalog
- Loading branch information
Showing
8 changed files
with
172 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
59 changes: 59 additions & 0 deletions
59
paimon-core/src/main/java/org/apache/paimon/rest/requests/AlertDatabaseRequest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.paimon.rest.requests; | ||
|
||
import org.apache.paimon.rest.RESTRequest; | ||
|
||
import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonCreator; | ||
import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonGetter; | ||
import org.apache.paimon.shade.jackson2.com.fasterxml.jackson.annotation.JsonProperty; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
/** Request for alerting database. */ | ||
public class AlertDatabaseRequest implements RESTRequest { | ||
|
||
private static final String FIELD_REMOVALS = "removals"; | ||
private static final String FIELD_UPDATES = "updates"; | ||
|
||
@JsonProperty(FIELD_REMOVALS) | ||
private List<String> removals; | ||
|
||
@JsonProperty(FIELD_UPDATES) | ||
private Map<String, String> updates; | ||
|
||
@JsonCreator | ||
public AlertDatabaseRequest( | ||
@JsonProperty(FIELD_REMOVALS) List<String> removals, | ||
@JsonProperty(FIELD_UPDATES) Map<String, String> updates) { | ||
this.removals = removals; | ||
this.updates = updates; | ||
} | ||
|
||
@JsonGetter(FIELD_REMOVALS) | ||
public List<String> getRemovals() { | ||
return removals; | ||
} | ||
|
||
@JsonGetter(FIELD_UPDATES) | ||
public Map<String, String> getUpdates() { | ||
return updates; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
paimon-core/src/main/java/org/apache/paimon/rest/responses/AlertDatabaseResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one | ||
* or more contributor license agreements. See the NOTICE file | ||
* distributed with this work for additional information | ||
* regarding copyright ownership. The ASF licenses this file | ||
* to you under the Apache License, Version 2.0 (the | ||
* "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.paimon.rest.responses; | ||
|
||
import org.apache.paimon.rest.RESTResponse; | ||
|
||
import java.util.List; | ||
|
||
/** Response for alerting database. */ | ||
public class AlertDatabaseResponse implements RESTResponse { | ||
|
||
// List of namespace property keys that were removed | ||
private List<String> removed; | ||
// List of namespace property keys that were added or updated | ||
private List<String> updated; | ||
// List of properties that were requested for removal that were not found in the namespace's | ||
// properties | ||
private List<String> missing; | ||
|
||
public AlertDatabaseResponse(List<String> removed, List<String> updated, List<String> missing) { | ||
this.removed = removed; | ||
this.updated = updated; | ||
this.missing = missing; | ||
} | ||
|
||
public List<String> getRemoved() { | ||
return removed; | ||
} | ||
|
||
public List<String> getUpdated() { | ||
return updated; | ||
} | ||
|
||
public List<String> getMissing() { | ||
return missing; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters