-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GNITE-18744 Implement primary replica side leaseGrant handler (#1765)
- Loading branch information
1 parent
64b518e
commit 9323ee9
Showing
43 changed files
with
1,991 additions
and
340 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* 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. | ||
*/ | ||
|
||
apply from: "$rootDir/buildscripts/java-core.gradle" | ||
apply from: "$rootDir/buildscripts/publishing.gradle" | ||
apply from: "$rootDir/buildscripts/java-junit5.gradle" | ||
|
||
dependencies { | ||
annotationProcessor project(":ignite-network-annotation-processor") | ||
|
||
implementation project(':ignite-core') | ||
implementation project(':ignite-network-api') | ||
} | ||
|
||
description = 'ignite-placement-driver-api' |
36 changes: 36 additions & 0 deletions
36
...src/main/java/org/apache/ignite/internal/placementdriver/message/LeaseGrantedMessage.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,36 @@ | ||
/* | ||
* 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.ignite.internal.placementdriver.message; | ||
|
||
import org.apache.ignite.internal.hlc.HybridTimestamp; | ||
import org.apache.ignite.network.annotations.Marshallable; | ||
import org.apache.ignite.network.annotations.Transferable; | ||
|
||
/** | ||
* Lease granted message. | ||
*/ | ||
@Transferable(PlacementDriverMessageGroup.LEASE_GRANTED_MESSAGE) | ||
public interface LeaseGrantedMessage extends PlacementDriverReplicaMessage { | ||
@Marshallable | ||
HybridTimestamp leaseStartTime(); | ||
|
||
@Marshallable | ||
HybridTimestamp leaseExpirationTime(); | ||
|
||
boolean force(); | ||
} |
30 changes: 30 additions & 0 deletions
30
.../java/org/apache/ignite/internal/placementdriver/message/LeaseGrantedMessageResponse.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,30 @@ | ||
/* | ||
* 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.ignite.internal.placementdriver.message; | ||
|
||
import org.apache.ignite.network.annotations.Transferable; | ||
|
||
/** | ||
* Response for lease granted message. | ||
*/ | ||
@Transferable(PlacementDriverMessageGroup.LEASE_GRANTED_MESSAGE_RESPONSE) | ||
public interface LeaseGrantedMessageResponse extends PlacementDriverReplicaMessage { | ||
boolean accepted(); | ||
|
||
String redirectProposal(); | ||
} |
38 changes: 38 additions & 0 deletions
38
.../java/org/apache/ignite/internal/placementdriver/message/PlacementDriverMessageGroup.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,38 @@ | ||
/* | ||
* 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.ignite.internal.placementdriver.message; | ||
|
||
import static org.apache.ignite.internal.placementdriver.message.PlacementDriverMessageGroup.GROUP_NAME; | ||
import static org.apache.ignite.internal.placementdriver.message.PlacementDriverMessageGroup.GROUP_TYPE; | ||
|
||
import org.apache.ignite.network.annotations.MessageGroup; | ||
|
||
/** | ||
* Message group for placement driver messages. | ||
*/ | ||
@MessageGroup(groupType = GROUP_TYPE, groupName = GROUP_NAME) | ||
public interface PlacementDriverMessageGroup { | ||
/** Placement driver message group type. */ | ||
short GROUP_TYPE = 11; | ||
|
||
String GROUP_NAME = "PlacementDriverMessages"; | ||
|
||
short LEASE_GRANTED_MESSAGE = 0; | ||
|
||
short LEASE_GRANTED_MESSAGE_RESPONSE = 1; | ||
} |
35 changes: 35 additions & 0 deletions
35
...ava/org/apache/ignite/internal/placementdriver/message/PlacementDriverReplicaMessage.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,35 @@ | ||
/* | ||
* 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.ignite.internal.placementdriver.message; | ||
|
||
import org.apache.ignite.internal.replicator.ReplicationGroupId; | ||
import org.apache.ignite.network.NetworkMessage; | ||
import org.apache.ignite.network.annotations.Marshallable; | ||
|
||
/** | ||
* Placement driver replica messages. | ||
*/ | ||
public interface PlacementDriverReplicaMessage extends NetworkMessage { | ||
/** | ||
* Gets a replication group id. | ||
* | ||
* @return Replication group id. | ||
*/ | ||
@Marshallable | ||
ReplicationGroupId groupId(); | ||
} |
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
Oops, something went wrong.