forked from apache/seatunnel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Improve][Zeta] Add an interface for batch retrieval of JobMetrics (a…
- Loading branch information
Showing
18 changed files
with
710 additions
and
4 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
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
48 changes: 48 additions & 0 deletions
48
seatunnel-engine/seatunnel-engine-client/src/test/resources/batch_fake_to_console.conf
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,48 @@ | ||
# | ||
# 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. | ||
# | ||
###### | ||
###### This config file is a demonstration of streaming processing in seatunnel config | ||
###### | ||
|
||
env { | ||
# You can set engine configuration here | ||
execution.parallelism = 1 | ||
job.mode = "BATCH" | ||
} | ||
|
||
source { | ||
# This is a example source plugin **only for test and demonstrate the feature source plugin** | ||
FakeSource { | ||
result_table_name = "fake" | ||
parallelism = 1 | ||
schema = { | ||
fields { | ||
name = "string" | ||
age = "int" | ||
} | ||
} | ||
} | ||
} | ||
|
||
transform { | ||
} | ||
|
||
sink { | ||
console { | ||
source_table_name="fake" | ||
} | ||
} |
84 changes: 84 additions & 0 deletions
84
...a/org/apache/seatunnel/engine/core/protocol/codec/SeaTunnelGetRunningJobMetricsCodec.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,84 @@ | ||
/* | ||
* 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.seatunnel.engine.core.protocol.codec; | ||
|
||
import com.hazelcast.client.impl.protocol.ClientMessage; | ||
import com.hazelcast.client.impl.protocol.Generated; | ||
import com.hazelcast.client.impl.protocol.codec.builtin.StringCodec; | ||
|
||
import static com.hazelcast.client.impl.protocol.ClientMessage.PARTITION_ID_FIELD_OFFSET; | ||
import static com.hazelcast.client.impl.protocol.ClientMessage.RESPONSE_BACKUP_ACKS_FIELD_OFFSET; | ||
import static com.hazelcast.client.impl.protocol.ClientMessage.TYPE_FIELD_OFFSET; | ||
import static com.hazelcast.client.impl.protocol.ClientMessage.UNFRAGMENTED_MESSAGE; | ||
import static com.hazelcast.client.impl.protocol.codec.builtin.FixedSizeTypesCodec.BYTE_SIZE_IN_BYTES; | ||
import static com.hazelcast.client.impl.protocol.codec.builtin.FixedSizeTypesCodec.INT_SIZE_IN_BYTES; | ||
import static com.hazelcast.client.impl.protocol.codec.builtin.FixedSizeTypesCodec.encodeInt; | ||
|
||
/* | ||
* This file is auto-generated by the Hazelcast Client Protocol Code Generator. | ||
* To change this file, edit the templates or the protocol | ||
* definitions on the https://github.com/hazelcast/hazelcast-client-protocol | ||
* and regenerate it. | ||
*/ | ||
|
||
/** */ | ||
@Generated("2a54110c40297eed90df5f79bde1171d") | ||
public final class SeaTunnelGetRunningJobMetricsCodec { | ||
// hex: 0xDE0C00 | ||
public static final int REQUEST_MESSAGE_TYPE = 14552064; | ||
// hex: 0xDE0C01 | ||
public static final int RESPONSE_MESSAGE_TYPE = 14552065; | ||
private static final int REQUEST_INITIAL_FRAME_SIZE = | ||
PARTITION_ID_FIELD_OFFSET + INT_SIZE_IN_BYTES; | ||
private static final int RESPONSE_INITIAL_FRAME_SIZE = | ||
RESPONSE_BACKUP_ACKS_FIELD_OFFSET + BYTE_SIZE_IN_BYTES; | ||
|
||
private SeaTunnelGetRunningJobMetricsCodec() {} | ||
|
||
public static ClientMessage encodeRequest() { | ||
ClientMessage clientMessage = ClientMessage.createForEncode(); | ||
clientMessage.setRetryable(true); | ||
clientMessage.setOperationName("SeaTunnel.GetRunningJobMetrics"); | ||
ClientMessage.Frame initialFrame = | ||
new ClientMessage.Frame(new byte[REQUEST_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE); | ||
encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, REQUEST_MESSAGE_TYPE); | ||
encodeInt(initialFrame.content, PARTITION_ID_FIELD_OFFSET, -1); | ||
clientMessage.add(initialFrame); | ||
return clientMessage; | ||
} | ||
|
||
public static ClientMessage encodeResponse(java.lang.String response) { | ||
ClientMessage clientMessage = ClientMessage.createForEncode(); | ||
ClientMessage.Frame initialFrame = | ||
new ClientMessage.Frame( | ||
new byte[RESPONSE_INITIAL_FRAME_SIZE], UNFRAGMENTED_MESSAGE); | ||
encodeInt(initialFrame.content, TYPE_FIELD_OFFSET, RESPONSE_MESSAGE_TYPE); | ||
clientMessage.add(initialFrame); | ||
|
||
StringCodec.encode(clientMessage, response); | ||
return clientMessage; | ||
} | ||
|
||
/** */ | ||
public static java.lang.String decodeResponse(ClientMessage clientMessage) { | ||
ClientMessage.ForwardFrameIterator iterator = clientMessage.frameIterator(); | ||
// empty initial frame | ||
iterator.next(); | ||
return StringCodec.decode(iterator); | ||
} | ||
} |
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
Oops, something went wrong.