diff --git a/demos/_java_serverless_lib/core/src/main/java/io/serverless_lib/process_rpc_proto/ProcessRpcProto.java b/demos/_java_serverless_lib/core/src/main/java/io/serverless_lib/process_rpc_proto/ProcessRpcProto.java index 708bd5b..90ad156 100644 --- a/demos/_java_serverless_lib/core/src/main/java/io/serverless_lib/process_rpc_proto/ProcessRpcProto.java +++ b/demos/_java_serverless_lib/core/src/main/java/io/serverless_lib/process_rpc_proto/ProcessRpcProto.java @@ -57,6 +57,7 @@ public static final class AppStarted extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:process_rpc_proto.AppStarted) AppStartedOrBuilder { + private static final long serialVersionUID = 0L; // Use AppStarted.newBuilder() to construct. private AppStarted(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); @@ -76,6 +77,9 @@ private AppStarted( com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -87,13 +91,6 @@ private AppStarted( case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 10: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; @@ -106,6 +103,13 @@ private AppStarted( httpPort_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -123,6 +127,7 @@ private AppStarted( return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_AppStarted_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_AppStarted_fieldAccessorTable @@ -216,6 +221,7 @@ public java.lang.String getHttpPort() { } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -229,6 +235,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -240,6 +247,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -256,7 +264,6 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { @@ -288,7 +295,7 @@ public int hashCode() { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); if (hasAppid()) { hash = (37 * hash) + APPID_FIELD_NUMBER; hash = (53 * hash) + getAppid().hashCode(); @@ -302,6 +309,17 @@ public int hashCode() { return hash; } + public static process_rpc_proto.ProcessRpcProto.AppStarted parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static process_rpc_proto.ProcessRpcProto.AppStarted parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } public static process_rpc_proto.ProcessRpcProto.AppStarted parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -361,6 +379,7 @@ public static process_rpc_proto.ProcessRpcProto.AppStarted parseFrom( .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -368,6 +387,7 @@ public static Builder newBuilder() { public static Builder newBuilder(process_rpc_proto.ProcessRpcProto.AppStarted prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); @@ -395,6 +415,7 @@ public static final class Builder extends return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_AppStarted_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_AppStarted_fieldAccessorTable @@ -417,6 +438,7 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { } } + @java.lang.Override public Builder clear() { super.clear(); appid_ = ""; @@ -426,15 +448,18 @@ public Builder clear() { return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_AppStarted_descriptor; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.AppStarted getDefaultInstanceForType() { return process_rpc_proto.ProcessRpcProto.AppStarted.getDefaultInstance(); } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.AppStarted build() { process_rpc_proto.ProcessRpcProto.AppStarted result = buildPartial(); if (!result.isInitialized()) { @@ -443,6 +468,7 @@ public process_rpc_proto.ProcessRpcProto.AppStarted build() { return result; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.AppStarted buildPartial() { process_rpc_proto.ProcessRpcProto.AppStarted result = new process_rpc_proto.ProcessRpcProto.AppStarted(this); int from_bitField0_ = bitField0_; @@ -460,32 +486,39 @@ public process_rpc_proto.ProcessRpcProto.AppStarted buildPartial() { return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { + int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof process_rpc_proto.ProcessRpcProto.AppStarted) { return mergeFrom((process_rpc_proto.ProcessRpcProto.AppStarted)other); @@ -512,6 +545,7 @@ public Builder mergeFrom(process_rpc_proto.ProcessRpcProto.AppStarted other) { return this; } + @java.lang.Override public final boolean isInitialized() { if (!hasAppid()) { return false; @@ -519,6 +553,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -689,11 +724,13 @@ public Builder setHttpPortBytes( onChanged(); return this; } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } + @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); @@ -715,11 +752,12 @@ public static process_rpc_proto.ProcessRpcProto.AppStarted getDefaultInstance() @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public AppStarted parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new AppStarted(input, extensionRegistry); + return new AppStarted(input, extensionRegistry); } }; @@ -732,6 +770,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.AppStarted getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -777,6 +816,7 @@ public static final class FuncCallReq extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:process_rpc_proto.FuncCallReq) FuncCallReqOrBuilder { + private static final long serialVersionUID = 0L; // Use FuncCallReq.newBuilder() to construct. private FuncCallReq(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); @@ -796,6 +836,9 @@ private FuncCallReq( com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -807,13 +850,6 @@ private FuncCallReq( case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 10: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; @@ -826,6 +862,13 @@ private FuncCallReq( argStr_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -843,6 +886,7 @@ private FuncCallReq( return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallReq_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallReq_fieldAccessorTable @@ -936,6 +980,7 @@ public java.lang.String getArgStr() { } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -953,6 +998,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -964,6 +1010,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -980,7 +1027,6 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { @@ -1012,7 +1058,7 @@ public int hashCode() { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); if (hasFunc()) { hash = (37 * hash) + FUNC_FIELD_NUMBER; hash = (53 * hash) + getFunc().hashCode(); @@ -1026,6 +1072,17 @@ public int hashCode() { return hash; } + public static process_rpc_proto.ProcessRpcProto.FuncCallReq parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static process_rpc_proto.ProcessRpcProto.FuncCallReq parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } public static process_rpc_proto.ProcessRpcProto.FuncCallReq parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1085,6 +1142,7 @@ public static process_rpc_proto.ProcessRpcProto.FuncCallReq parseFrom( .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -1092,6 +1150,7 @@ public static Builder newBuilder() { public static Builder newBuilder(process_rpc_proto.ProcessRpcProto.FuncCallReq prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); @@ -1115,6 +1174,7 @@ public static final class Builder extends return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallReq_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallReq_fieldAccessorTable @@ -1137,6 +1197,7 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { } } + @java.lang.Override public Builder clear() { super.clear(); func_ = ""; @@ -1146,15 +1207,18 @@ public Builder clear() { return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallReq_descriptor; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallReq getDefaultInstanceForType() { return process_rpc_proto.ProcessRpcProto.FuncCallReq.getDefaultInstance(); } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallReq build() { process_rpc_proto.ProcessRpcProto.FuncCallReq result = buildPartial(); if (!result.isInitialized()) { @@ -1163,6 +1227,7 @@ public process_rpc_proto.ProcessRpcProto.FuncCallReq build() { return result; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallReq buildPartial() { process_rpc_proto.ProcessRpcProto.FuncCallReq result = new process_rpc_proto.ProcessRpcProto.FuncCallReq(this); int from_bitField0_ = bitField0_; @@ -1180,32 +1245,39 @@ public process_rpc_proto.ProcessRpcProto.FuncCallReq buildPartial() { return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { + int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof process_rpc_proto.ProcessRpcProto.FuncCallReq) { return mergeFrom((process_rpc_proto.ProcessRpcProto.FuncCallReq)other); @@ -1232,6 +1304,7 @@ public Builder mergeFrom(process_rpc_proto.ProcessRpcProto.FuncCallReq other) { return this; } + @java.lang.Override public final boolean isInitialized() { if (!hasFunc()) { return false; @@ -1242,6 +1315,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1412,11 +1486,13 @@ public Builder setArgStrBytes( onChanged(); return this; } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } + @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); @@ -1438,11 +1514,12 @@ public static process_rpc_proto.ProcessRpcProto.FuncCallReq getDefaultInstance() @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public FuncCallReq parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new FuncCallReq(input, extensionRegistry); + return new FuncCallReq(input, extensionRegistry); } }; @@ -1455,6 +1532,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallReq getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -1486,6 +1564,7 @@ public static final class FuncCallResp extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:process_rpc_proto.FuncCallResp) FuncCallRespOrBuilder { + private static final long serialVersionUID = 0L; // Use FuncCallResp.newBuilder() to construct. private FuncCallResp(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); @@ -1504,6 +1583,9 @@ private FuncCallResp( com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } int mutable_bitField0_ = 0; com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); @@ -1515,19 +1597,19 @@ private FuncCallResp( case 0: done = true; break; - default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { - done = true; - } - break; - } case 10: { com.google.protobuf.ByteString bs = input.readBytes(); bitField0_ |= 0x00000001; retStr_ = bs; break; } + default: { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { + done = true; + } + break; + } } } } catch (com.google.protobuf.InvalidProtocolBufferException e) { @@ -1545,6 +1627,7 @@ private FuncCallResp( return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallResp_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallResp_fieldAccessorTable @@ -1596,6 +1679,7 @@ public java.lang.String getRetStr() { } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -1609,6 +1693,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { if (((bitField0_ & 0x00000001) == 0x00000001)) { @@ -1617,6 +1702,7 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -1630,7 +1716,6 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { @@ -1657,7 +1742,7 @@ public int hashCode() { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); if (hasRetStr()) { hash = (37 * hash) + RET_STR_FIELD_NUMBER; hash = (53 * hash) + getRetStr().hashCode(); @@ -1667,6 +1752,17 @@ public int hashCode() { return hash; } + public static process_rpc_proto.ProcessRpcProto.FuncCallResp parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static process_rpc_proto.ProcessRpcProto.FuncCallResp parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } public static process_rpc_proto.ProcessRpcProto.FuncCallResp parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -1726,6 +1822,7 @@ public static process_rpc_proto.ProcessRpcProto.FuncCallResp parseFrom( .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -1733,6 +1830,7 @@ public static Builder newBuilder() { public static Builder newBuilder(process_rpc_proto.ProcessRpcProto.FuncCallResp prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); @@ -1756,6 +1854,7 @@ public static final class Builder extends return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallResp_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallResp_fieldAccessorTable @@ -1778,6 +1877,7 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { } } + @java.lang.Override public Builder clear() { super.clear(); retStr_ = ""; @@ -1785,15 +1885,18 @@ public Builder clear() { return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_FuncCallResp_descriptor; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallResp getDefaultInstanceForType() { return process_rpc_proto.ProcessRpcProto.FuncCallResp.getDefaultInstance(); } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallResp build() { process_rpc_proto.ProcessRpcProto.FuncCallResp result = buildPartial(); if (!result.isInitialized()) { @@ -1802,6 +1905,7 @@ public process_rpc_proto.ProcessRpcProto.FuncCallResp build() { return result; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallResp buildPartial() { process_rpc_proto.ProcessRpcProto.FuncCallResp result = new process_rpc_proto.ProcessRpcProto.FuncCallResp(this); int from_bitField0_ = bitField0_; @@ -1815,32 +1919,39 @@ public process_rpc_proto.ProcessRpcProto.FuncCallResp buildPartial() { return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { + int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof process_rpc_proto.ProcessRpcProto.FuncCallResp) { return mergeFrom((process_rpc_proto.ProcessRpcProto.FuncCallResp)other); @@ -1862,6 +1973,7 @@ public Builder mergeFrom(process_rpc_proto.ProcessRpcProto.FuncCallResp other) { return this; } + @java.lang.Override public final boolean isInitialized() { if (!hasRetStr()) { return false; @@ -1869,6 +1981,7 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -1963,11 +2076,13 @@ public Builder setRetStrBytes( onChanged(); return this; } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } + @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); @@ -1989,11 +2104,12 @@ public static process_rpc_proto.ProcessRpcProto.FuncCallResp getDefaultInstance( @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public FuncCallResp parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new FuncCallResp(input, extensionRegistry); + return new FuncCallResp(input, extensionRegistry); } }; @@ -2006,6 +2122,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.FuncCallResp getDefaultInstanceForType() { return DEFAULT_INSTANCE; } @@ -2023,6 +2140,7 @@ public static final class UpdateCheckpoint extends com.google.protobuf.GeneratedMessageV3 implements // @@protoc_insertion_point(message_implements:process_rpc_proto.UpdateCheckpoint) UpdateCheckpointOrBuilder { + private static final long serialVersionUID = 0L; // Use UpdateCheckpoint.newBuilder() to construct. private UpdateCheckpoint(com.google.protobuf.GeneratedMessageV3.Builder builder) { super(builder); @@ -2040,6 +2158,9 @@ private UpdateCheckpoint( com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { this(); + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } com.google.protobuf.UnknownFieldSet.Builder unknownFields = com.google.protobuf.UnknownFieldSet.newBuilder(); try { @@ -2051,8 +2172,8 @@ private UpdateCheckpoint( done = true; break; default: { - if (!parseUnknownField(input, unknownFields, - extensionRegistry, tag)) { + if (!parseUnknownField( + input, unknownFields, extensionRegistry, tag)) { done = true; } break; @@ -2074,6 +2195,7 @@ private UpdateCheckpoint( return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_UpdateCheckpoint_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_UpdateCheckpoint_fieldAccessorTable @@ -2082,6 +2204,7 @@ private UpdateCheckpoint( } private byte memoizedIsInitialized = -1; + @java.lang.Override public final boolean isInitialized() { byte isInitialized = memoizedIsInitialized; if (isInitialized == 1) return true; @@ -2091,11 +2214,13 @@ public final boolean isInitialized() { return true; } + @java.lang.Override public void writeTo(com.google.protobuf.CodedOutputStream output) throws java.io.IOException { unknownFields.writeTo(output); } + @java.lang.Override public int getSerializedSize() { int size = memoizedSize; if (size != -1) return size; @@ -2106,7 +2231,6 @@ public int getSerializedSize() { return size; } - private static final long serialVersionUID = 0L; @java.lang.Override public boolean equals(final java.lang.Object obj) { if (obj == this) { @@ -2128,12 +2252,23 @@ public int hashCode() { return memoizedHashCode; } int hash = 41; - hash = (19 * hash) + getDescriptorForType().hashCode(); + hash = (19 * hash) + getDescriptor().hashCode(); hash = (29 * hash) + unknownFields.hashCode(); memoizedHashCode = hash; return hash; } + public static process_rpc_proto.ProcessRpcProto.UpdateCheckpoint parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static process_rpc_proto.ProcessRpcProto.UpdateCheckpoint parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } public static process_rpc_proto.ProcessRpcProto.UpdateCheckpoint parseFrom( com.google.protobuf.ByteString data) throws com.google.protobuf.InvalidProtocolBufferException { @@ -2193,6 +2328,7 @@ public static process_rpc_proto.ProcessRpcProto.UpdateCheckpoint parseFrom( .parseWithIOException(PARSER, input, extensionRegistry); } + @java.lang.Override public Builder newBuilderForType() { return newBuilder(); } public static Builder newBuilder() { return DEFAULT_INSTANCE.toBuilder(); @@ -2200,6 +2336,7 @@ public static Builder newBuilder() { public static Builder newBuilder(process_rpc_proto.ProcessRpcProto.UpdateCheckpoint prototype) { return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); } + @java.lang.Override public Builder toBuilder() { return this == DEFAULT_INSTANCE ? new Builder() : new Builder().mergeFrom(this); @@ -2223,6 +2360,7 @@ public static final class Builder extends return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_UpdateCheckpoint_descriptor; } + @java.lang.Override protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_UpdateCheckpoint_fieldAccessorTable @@ -2245,20 +2383,24 @@ private void maybeForceBuilderInitialization() { .alwaysUseFieldBuilders) { } } + @java.lang.Override public Builder clear() { super.clear(); return this; } + @java.lang.Override public com.google.protobuf.Descriptors.Descriptor getDescriptorForType() { return process_rpc_proto.ProcessRpcProto.internal_static_process_rpc_proto_UpdateCheckpoint_descriptor; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.UpdateCheckpoint getDefaultInstanceForType() { return process_rpc_proto.ProcessRpcProto.UpdateCheckpoint.getDefaultInstance(); } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.UpdateCheckpoint build() { process_rpc_proto.ProcessRpcProto.UpdateCheckpoint result = buildPartial(); if (!result.isInitialized()) { @@ -2267,38 +2409,46 @@ public process_rpc_proto.ProcessRpcProto.UpdateCheckpoint build() { return result; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.UpdateCheckpoint buildPartial() { process_rpc_proto.ProcessRpcProto.UpdateCheckpoint result = new process_rpc_proto.ProcessRpcProto.UpdateCheckpoint(this); onBuilt(); return result; } + @java.lang.Override public Builder clone() { return (Builder) super.clone(); } + @java.lang.Override public Builder setField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.setField(field, value); } + @java.lang.Override public Builder clearField( com.google.protobuf.Descriptors.FieldDescriptor field) { return (Builder) super.clearField(field); } + @java.lang.Override public Builder clearOneof( com.google.protobuf.Descriptors.OneofDescriptor oneof) { return (Builder) super.clearOneof(oneof); } + @java.lang.Override public Builder setRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - int index, Object value) { + int index, java.lang.Object value) { return (Builder) super.setRepeatedField(field, index, value); } + @java.lang.Override public Builder addRepeatedField( com.google.protobuf.Descriptors.FieldDescriptor field, - Object value) { + java.lang.Object value) { return (Builder) super.addRepeatedField(field, value); } + @java.lang.Override public Builder mergeFrom(com.google.protobuf.Message other) { if (other instanceof process_rpc_proto.ProcessRpcProto.UpdateCheckpoint) { return mergeFrom((process_rpc_proto.ProcessRpcProto.UpdateCheckpoint)other); @@ -2315,10 +2465,12 @@ public Builder mergeFrom(process_rpc_proto.ProcessRpcProto.UpdateCheckpoint othe return this; } + @java.lang.Override public final boolean isInitialized() { return true; } + @java.lang.Override public Builder mergeFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) @@ -2336,11 +2488,13 @@ public Builder mergeFrom( } return this; } + @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.setUnknownFields(unknownFields); } + @java.lang.Override public final Builder mergeUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { return super.mergeUnknownFields(unknownFields); @@ -2362,11 +2516,12 @@ public static process_rpc_proto.ProcessRpcProto.UpdateCheckpoint getDefaultInsta @java.lang.Deprecated public static final com.google.protobuf.Parser PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override public UpdateCheckpoint parsePartialFrom( com.google.protobuf.CodedInputStream input, com.google.protobuf.ExtensionRegistryLite extensionRegistry) throws com.google.protobuf.InvalidProtocolBufferException { - return new UpdateCheckpoint(input, extensionRegistry); + return new UpdateCheckpoint(input, extensionRegistry); } }; @@ -2379,6 +2534,7 @@ public com.google.protobuf.Parser getParserForType() { return PARSER; } + @java.lang.Override public process_rpc_proto.ProcessRpcProto.UpdateCheckpoint getDefaultInstanceForType() { return DEFAULT_INSTANCE; } diff --git a/demos/_java_serverless_lib/pom.xml b/demos/_java_serverless_lib/pom.xml index f8c76f8..a4d17da 100644 --- a/demos/_java_serverless_lib/pom.xml +++ b/demos/_java_serverless_lib/pom.xml @@ -16,7 +16,7 @@ org.springframework.boot spring-boot-starter-parent - 3.2.4.CRAC + 3.2.4 @@ -26,11 +26,11 @@ - + io.serverless_lib serverless-lib-core diff --git a/demos/java_web/stock-mng/pom.xml b/demos/java_web/stock-mng/pom.xml index 822708a..5d745aa 100644 --- a/demos/java_web/stock-mng/pom.xml +++ b/demos/java_web/stock-mng/pom.xml @@ -30,11 +30,11 @@ serverless-lib-core - + mysql mysql-connector-java diff --git a/demos/java_web/stock-mng/src/main/java/io/sofastack/stockmng/controller/impl/BookStoreControllerImpl.java b/demos/java_web/stock-mng/src/main/java/io/sofastack/stockmng/controller/impl/BookStoreControllerImpl.java index 170c5cf..9f9e21c 100644 --- a/demos/java_web/stock-mng/src/main/java/io/sofastack/stockmng/controller/impl/BookStoreControllerImpl.java +++ b/demos/java_web/stock-mng/src/main/java/io/sofastack/stockmng/controller/impl/BookStoreControllerImpl.java @@ -6,7 +6,7 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; -import io.sofastack.balance.manage.facade.BalanceMngFacade; +// import io.sofastack.balance.manage.facade.BalanceMngFacade; import io.sofastack.stockmng.controller.BookStoreController; import io.sofastack.stockmng.facade.StockMngFacade; import io.sofastack.stockmng.model.BalanceResponse; diff --git a/scripts/build/1.1build_core.py b/scripts/build/1.1build_core.py index 2ae1ca7..7ff215d 100644 --- a/scripts/build/1.1build_core.py +++ b/scripts/build/1.1build_core.py @@ -37,5 +37,5 @@ def print_title(title): os_system_sure("mkdir -p pack/waverless_backend") BACKEND_PATH=os.path.abspath("pack/waverless_backend") os.chdir("../../") -os_system_sure("cargo build --release") +os_system_sure("$HOME/.cargo/bin/cargo build --release") os_system_sure(f"cp target/release/wasm_serverless {BACKEND_PATH}") \ No newline at end of file diff --git a/scripts/build/1.2build_apps.py b/scripts/build/1.2build_apps.py index 9ea6514..360b024 100644 --- a/scripts/build/1.2build_apps.py +++ b/scripts/build/1.2build_apps.py @@ -114,7 +114,7 @@ def pack_demo(app): os.chdir(prj_dir) # check Cargo.toml in the current directory if os.path.exists("Cargo.toml"): - os_system_sure("cargo build --target wasm32-wasi --release") + os_system_sure("$HOME/.cargo/bin/cargo build --target wasm32-wasi --release") elif os.path.exists("pom.xml"): os_system_sure("mvn clean package") else: @@ -149,6 +149,10 @@ def open_app_conf(app): type: SOCKET action: close""") +# install java lib +os.chdir("../../demos/_java_serverless_lib") +os_system_sure("mvn clean install") + for app in DEMOS: os.chdir(CUR_FDIR) pack_demo(app) \ No newline at end of file diff --git a/scripts/build/1.4pack_with_ui.py b/scripts/build/1.4pack_with_ui.py index 01733af..76b5c81 100644 --- a/scripts/build/1.4pack_with_ui.py +++ b/scripts/build/1.4pack_with_ui.py @@ -44,5 +44,7 @@ def cp_except(src, dest, exclude_list): os_system_sure("rm -rf pack/waverless_ui") +os_system_sure("mkdir -p pack/waverless_ui") + cp_except("../../waverless_ui", "pack/waverless_ui", ["dist", "node_modules"]) diff --git a/scripts/install/.gitignore b/scripts/install/.gitignore index d3f7865..3391ce9 100644 --- a/scripts/install/.gitignore +++ b/scripts/install/.gitignore @@ -1 +1,3 @@ -WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz \ No newline at end of file +WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz +WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz.1 +llvm.sh \ No newline at end of file diff --git a/scripts/install/2.1install_wasmedge.py b/scripts/install/2.1install_wasmedge.py index ad25f0b..23203d4 100644 --- a/scripts/install/2.1install_wasmedge.py +++ b/scripts/install/2.1install_wasmedge.py @@ -37,6 +37,7 @@ def print_title(title): VERSION="0.13.3" TARGZ_FILE = f"WasmEdge-{VERSION}-manylinux2014_x86_64.tar.gz" if not os.path.exists(f"/tmp/install/{TARGZ_FILE}"): + os_system_sure("mkdir -p /tmp/install/") os_system_sure(f"wget https://github.com/WasmEdge/WasmEdge/releases/download/{VERSION}/{TARGZ_FILE}") os_system_sure(f"mv {TARGZ_FILE} /tmp/install/") @@ -47,7 +48,7 @@ def print_title(title): print_title("debug wasmedge") os_system_sure("ls /root/.wasmedge/bin/") -os_system_sure("wasmedge --version") +os_system_sure("/root/.wasmedge/bin/wasmedge --version") # - name: Install WasmEdge # become: true # shell: | diff --git a/scripts/install/2.3install_java_related.py b/scripts/install/2.3install_java_related.py new file mode 100644 index 0000000..031d149 --- /dev/null +++ b/scripts/install/2.3install_java_related.py @@ -0,0 +1,42 @@ +### chdir +import os +import sys +import yaml +import zipfile + +CUR_FPATH = os.path.abspath(__file__) +CUR_FDIR = os.path.dirname(CUR_FPATH) +# chdir to the directory of this script +os.chdir(CUR_FDIR) + +# os.system('ansible-playbook -vv 2.ans_install_build.yml -i ../local_ansible_conf.ini') +### utils +def os_system_sure(command): + print(f">>> Run:{command}") + result = os.system(command) + if result != 0: + print(f">>> Fail:{command}\n\n") + exit(1) + print(f">>> Succ:{command}\n\n") + + +# result.returncode +# result.stdout +def run_cmd_return(cmd): + print(f"Run:{cmd}") + result = subprocess.run(command, shell=True, capture_output=True, text=True) + print(f"Stdout:{result.stdout}\n\n") + return result + + +def print_title(title): + print(f"\n\n>>> {title}") +################################################################################################# + +os_system_sure("python3 inner/install_maven.py") + +CRAC_INSTALL_DIR = "/usr/jdk_crac" +if not os.path.exists(CRAC_INSTALL_DIR): + os_system_sure("python3 inner/install_crac.py") + +os_system_sure("python3 inner/switch_jdk_17crac.py") \ No newline at end of file diff --git a/scripts/install/2.install_build.py b/scripts/install/2.install_build.py index 47c7baf..c52e04b 100644 --- a/scripts/install/2.install_build.py +++ b/scripts/install/2.install_build.py @@ -45,12 +45,12 @@ def run_cmd_return(cmd): os_system_sure("python3 2.2install_clang.py") -res=run_cmd_return("rustc --version") +res=run_cmd_return("$HOME/.cargo/bin/rustc --version") if res.returncode != 0: print("Rust not installed, installing now...") os_system_sure("curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y") # os_system_sure("source $HOME/.cargo/env") - os_system_sure("rustup target add wasm32-wasi") + os_system_sure("$HOME/.cargo/bin/rustup target add wasm32-wasi") # os_system_sure("export PATH=$HOME/.cargo/bin:$PATH") diff --git a/scripts/install/inner/.gitignore b/scripts/install/inner/.gitignore index d3f7865..b804234 100644 --- a/scripts/install/inner/.gitignore +++ b/scripts/install/inner/.gitignore @@ -1 +1,4 @@ -WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz \ No newline at end of file +WasmEdge-0.13.3-manylinux2014_x86_64.tar.gz +apache-maven-3.9.6-bin.tar.gz +apache-maven-3.9.6 +crac \ No newline at end of file diff --git a/scripts/install/inner/install_crac.py b/scripts/install/inner/install_crac.py new file mode 100644 index 0000000..ec09e76 --- /dev/null +++ b/scripts/install/inner/install_crac.py @@ -0,0 +1,78 @@ + +### chdir +import os +CUR_FPATH = os.path.abspath(__file__) +CUR_FDIR = os.path.dirname(CUR_FPATH) +# chdir to the directory of this script +os.chdir(CUR_FDIR) + + +### utils +def os_system_sure(command): + print(f"执行命令:{command}") + result = os.system(command) + if result != 0: + print(f"命令执行失败:{command}") + exit(1) + print(f"命令执行成功:{command}") + + +CRAC_INSTALL_DIR = "/usr/jdk_crac" + + + +def compile_crac(): + os_system_sure("apt install build-essential autoconf openjdk-17-jdk -y") + os.system("git clone https://github.com/ActivePeter/crac") + os.chdir("crac") + os_system_sure("git checkout sofacrac17") + installs=[ + 'libfontconfig1-dev', + 'libx11-dev libxrender-dev libxrandr-dev libxtst-dev libxt-dev', + 'zip unzip', + 'file', + 'build-essential', + 'libasound2-dev', + 'libcups2-dev' + ] + + os_system_sure("apt update") + os_system_sure("apt install {} -y".format(" ".join(installs))) + + bins=[ + "java", + "javac", + "jcmd" + ] + OPENJDK="/usr/lib/jvm/java-17-openjdk-amd64/" + # swicth back to openjdk + for bin in bins: + # os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {OPENJDK}bin/{bin} 1") + os_system_sure(f"update-alternatives --set {bin} {OPENJDK}bin/{bin}") + + os_system_sure("bash configure") + os_system_sure("make images") + CRIU_PATH = "build/linux-x86_64-server-release/images/jdk/lib/criu" + if not os.path.exists(CRIU_PATH): + os_system_sure("wget https://github.com/CRaC/criu/releases/download/release-crac/criu-dist.tar.gz") + os_system_sure("tar -zxvf criu-dist.tar.gz") + os_system_sure(f"cp criu-dist/sbin/criu {CRIU_PATH}") + + os_system_sure("rm -rf {}".format(CRAC_INSTALL_DIR)) + os_system_sure(f"cp -r build/linux-x86_64-server-release/images/jdk/ {CRAC_INSTALL_DIR}") + # switch to crac jdk + + for bin in bins: + os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {CRAC_INSTALL_DIR}/bin/{bin} 100") + os_system_sure(f"update-alternatives --set {bin} {CRAC_INSTALL_DIR}/bin/{bin}") + + + + +def download_crac_bin(): + if not os.path.exists("./bellsoft-jdk17.0.10+14-linux-amd64-crac.deb"): + os_system_sure("wget https://download.bell-sw.com/java/17.0.10+14/bellsoft-jdk17.0.10+14-linux-amd64-crac.deb") + + os_system_sure("dpkg -i bellsoft-jdk17.0.10+14-linux-amd64-crac.deb") + +compile_crac() \ No newline at end of file diff --git a/scripts/install/inner/install_maven.py b/scripts/install/inner/install_maven.py new file mode 100644 index 0000000..5b9248a --- /dev/null +++ b/scripts/install/inner/install_maven.py @@ -0,0 +1,52 @@ + +### chdir +import os +CUR_FPATH = os.path.abspath(__file__) +CUR_FDIR = os.path.dirname(CUR_FPATH) +# chdir to the directory of this script +os.chdir(CUR_FDIR) + + +### utils +def os_system_sure(command): + print(f"执行命令:{command}") + result = os.system(command) + if result != 0: + print(f"命令执行失败:{command}") + exit(1) + print(f"命令执行成功:{command}") + + + +if os.path.exists("apache-maven-3.9.6-bin.tar.gz"): + print("maven已存在,无需再次下载") +else: + os_system_sure("wget https://dlcdn.apache.org/maven/maven-3/3.9.6/binaries/apache-maven-3.9.6-bin.tar.gz") + + + +if os.path.exists("apache-maven-3.9.6"): + print("maven已解压,无需再次解压") +else: + os_system_sure("tar -zxvf apache-maven-3.9.6-bin.tar.gz") + + + +MAVEN="/usr/lib/mvn" +os_system_sure("mkdir -p "+MAVEN) +os_system_sure("cp -r apache-maven-3.9.6 "+MAVEN) + + + +bins=[ + "mvn", + "mvnDebug", + "mvnyjp", +] + + + +for bin in bins: + os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {MAVEN}/apache-maven-3.9.6/bin/{bin} 1") + os_system_sure(f"update-alternatives --set {bin} {MAVEN}/apache-maven-3.9.6/bin/{bin}") + diff --git a/scripts/install/inner/switch_jdk_17crac.py b/scripts/install/inner/switch_jdk_17crac.py new file mode 100644 index 0000000..d59c7b4 --- /dev/null +++ b/scripts/install/inner/switch_jdk_17crac.py @@ -0,0 +1,50 @@ + +### chdir +import os +CUR_FPATH = os.path.abspath(__file__) +CUR_FDIR = os.path.dirname(CUR_FPATH) +# chdir to the directory of this script +os.chdir(CUR_FDIR) + + +### utils +def os_system_sure(command): + print(f"执行命令:{command}") + result = os.system(command) + if result != 0: + print(f"命令执行失败:{command}") + exit(1) + print(f"命令执行成功:{command}") + + +CRAC_INSTALL_DIR = "/usr/jdk_crac" + + +bins=[ + "java", + "javac", + "jcmd" + ] +# swicth back to openjdk +for bin in bins: + os_system_sure(f"update-alternatives --install /usr/bin/{bin} {bin} {CRAC_INSTALL_DIR}/bin/{bin} 100") + os_system_sure(f"update-alternatives --set {bin} {CRAC_INSTALL_DIR}/bin/{bin}") + + + + +# Check and update JAVA_HOME in /etc/environment +with open("/root/.bashrc", "r") as env_file: + lines = env_file.readlines() + +java_home_set = False +for line in lines: + if line.startswith("export JAVA_HOME="): + line=f"export JAVA_HOME={CRAC_INSTALL_DIR}\n" + java_home_set = True +if not java_home_set: + lines.append(f"export JAVA_HOME={CRAC_INSTALL_DIR}\n") +print("env lines: ",lines) + +with open("/root/.bashrc", "w") as env_file: + env_file.writelines(lines) diff --git a/src/master/m_master.rs b/src/master/m_master.rs index 90e3ed7..5b7327e 100644 --- a/src/master/m_master.rs +++ b/src/master/m_master.rs @@ -17,12 +17,14 @@ use crate::{ util::JoinHandleWrapper, }; +#[allow(dead_code)] trait NodeWeighteFetcher: Send + Sync + 'static { // NOTE: get weight return node weight // larger is better fn get_node_weight(&self, id: NodeID) -> f64; } +#[allow(dead_code)] struct StrawNodeSelector { weight_fetcher: Box, } @@ -54,6 +56,7 @@ pub trait NodeSelector: Send + Sync + 'static { fn select_node(&self, all_node_cnt: usize, fn_name: &str) -> NodeID; } +#[allow(dead_code)] struct HashNodeSelector; impl NodeSelector for HashNodeSelector {