-
Notifications
You must be signed in to change notification settings - Fork 169
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the entity class for Xds flow control functionality
Signed-off-by: hanbingleixue <[email protected]>
- Loading branch information
1 parent
7b2d7f8
commit b72bc93
Showing
22 changed files
with
1,126 additions
and
0 deletions.
There are no files selected for viewing
52 changes: 52 additions & 0 deletions
52
...nt-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/FractionalPercent.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,52 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* FractionalPercent configuration information | ||
* | ||
* @author zhp | ||
* @since 2024-11-18 | ||
*/ | ||
public class FractionalPercent { | ||
/** | ||
* The value of numerator | ||
*/ | ||
private int numerator; | ||
|
||
/** | ||
* Specifies the denominator. If the denominator specified is less than the numerator, the final fractional | ||
* percentage is capped at 1 (100%) | ||
*/ | ||
private int denominator; | ||
|
||
public int getNumerator() { | ||
return numerator; | ||
} | ||
|
||
public void setNumerator(int numerator) { | ||
this.numerator = numerator; | ||
} | ||
|
||
public int getDenominator() { | ||
return denominator; | ||
} | ||
|
||
public void setDenominator(int denominator) { | ||
this.denominator = denominator; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...ore/sermant-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/XdsAbort.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,51 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* Xds Abort information | ||
* | ||
* @author zhp | ||
* @since 2024-11-18 | ||
*/ | ||
public class XdsAbort { | ||
/** | ||
* HTTP status code to use to abort the HTTP request | ||
*/ | ||
private int httpStatus; | ||
|
||
/** | ||
* The percentage of requests/ operations/ connections that will be aborted with the error code | ||
*/ | ||
private float percentage; | ||
|
||
public int getHttpStatus() { | ||
return httpStatus; | ||
} | ||
|
||
public void setHttpStatus(int httpStatus) { | ||
this.httpStatus = httpStatus; | ||
} | ||
|
||
public float getPercentage() { | ||
return percentage; | ||
} | ||
|
||
public void setPercentage(float percentage) { | ||
this.percentage = percentage; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
...t-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/XdsCircuitBreakers.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 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* Xds circuit breaker information | ||
* | ||
* @author zhp | ||
* @since 2024-11-18 | ||
*/ | ||
public class XdsCircuitBreakers { | ||
/** | ||
* Maximum active request count | ||
*/ | ||
private int maxRequests; | ||
|
||
public int getMaxRequests() { | ||
return maxRequests; | ||
} | ||
|
||
public void setMaxRequests(int maxRequests) { | ||
this.maxRequests = maxRequests; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...ore/sermant-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/XdsDelay.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,51 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* Xds Delay information | ||
* | ||
* @author zhp | ||
* @since 2024-11-18 | ||
*/ | ||
public class XdsDelay { | ||
/** | ||
* the specified delay will be injected before a new request, in milliseconds. | ||
*/ | ||
private long fixedDelay; | ||
|
||
/** | ||
* The percentage of requests on which the delay will be injected | ||
*/ | ||
private float percentage; | ||
|
||
public long getFixedDelay() { | ||
return fixedDelay; | ||
} | ||
|
||
public void setFixedDelay(long fixedDelay) { | ||
this.fixedDelay = fixedDelay; | ||
} | ||
|
||
public float getPercentage() { | ||
return percentage; | ||
} | ||
|
||
public void setPercentage(float percentage) { | ||
this.percentage = percentage; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...re/sermant-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/XdsHeader.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,51 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* Header name/ value pair | ||
* | ||
* @author zhp | ||
* @since 2024-11-21 | ||
*/ | ||
public class XdsHeader { | ||
/** | ||
* Header name | ||
*/ | ||
private String key; | ||
|
||
/** | ||
* Header value | ||
*/ | ||
private String value; | ||
|
||
public String getKey() { | ||
return key; | ||
} | ||
|
||
public void setKey(String key) { | ||
this.key = key; | ||
} | ||
|
||
public String getValue() { | ||
return value; | ||
} | ||
|
||
public void setValue(String value) { | ||
this.value = value; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...mant-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/XdsHeaderOption.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,51 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* Header name/ value pair plus option to control append behavior | ||
* | ||
* @author zhp | ||
* @since 2024-11-21 | ||
*/ | ||
public class XdsHeaderOption { | ||
/** | ||
* Header name/ value pair that this option applies to | ||
*/ | ||
private XdsHeader header; | ||
|
||
/** | ||
* Should the value be appended | ||
*/ | ||
private boolean enabledAppend; | ||
|
||
public XdsHeader getHeader() { | ||
return header; | ||
} | ||
|
||
public void setHeader(XdsHeader header) { | ||
this.header = header; | ||
} | ||
|
||
public boolean isEnabledAppend() { | ||
return enabledAppend; | ||
} | ||
|
||
public void setEnabledAppend(boolean enabledAppend) { | ||
this.enabledAppend = enabledAppend; | ||
} | ||
} |
51 changes: 51 additions & 0 deletions
51
...sermant-agentcore-core/src/main/java/io/sermant/core/service/xds/entity/XdsHttpFault.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,51 @@ | ||
/* | ||
* Copyright (C) 2024-2024 Sermant Authors. All rights reserved. | ||
* | ||
* Licensed 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 io.sermant.core.service.xds.entity; | ||
|
||
/** | ||
* Xds fault information | ||
* | ||
* @author zhp | ||
* @since 2024-11-18 | ||
*/ | ||
public class XdsHttpFault { | ||
/** | ||
* abort information, If specified, the filter will abort requests based on the values in the object | ||
*/ | ||
private XdsAbort abort; | ||
|
||
/** | ||
* delay information, If specified, the filter will inject delays based on the values in the object | ||
*/ | ||
private XdsDelay delay; | ||
|
||
public XdsAbort getAbort() { | ||
return abort; | ||
} | ||
|
||
public void setAbort(XdsAbort abort) { | ||
this.abort = abort; | ||
} | ||
|
||
public XdsDelay getDelay() { | ||
return delay; | ||
} | ||
|
||
public void setDelay(XdsDelay delay) { | ||
this.delay = delay; | ||
} | ||
} |
Oops, something went wrong.