-
Notifications
You must be signed in to change notification settings - Fork 871
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
first full implementation of push of storage configuration and schema
- Loading branch information
Showing
33 changed files
with
951 additions
and
336 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
57 changes: 57 additions & 0 deletions
57
.../src/main/java/com/orientechnologies/orient/client/remote/message/OPushSchemaRequest.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,57 @@ | |||
package com.orientechnologies.orient.client.remote.message; | |||
|
|||
import com.orientechnologies.orient.client.remote.ORemotePushHandler; | |||
import com.orientechnologies.orient.client.remote.message.push.OStorageConfigurationPayload; | |||
import com.orientechnologies.orient.core.config.OStorageConfiguration; | |||
import com.orientechnologies.orient.core.record.impl.ODocument; | |||
import com.orientechnologies.orient.core.serialization.serializer.record.binary.ORecordSerializerNetworkV37; | |||
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataInput; | |||
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataOutput; | |||
|
|||
import java.io.IOException; | |||
|
|||
import static com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol.REQUEST_PUSH_SCHEMA; | |||
import static com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol.REQUEST_PUSH_STORAGE_CONFIG; | |||
|
|||
public class OPushSchemaRequest implements OBinaryPushRequest<OBinaryPushResponse> { | |||
|
|||
private ODocument schema; | |||
|
|||
public OPushSchemaRequest() { | |||
|
|||
} | |||
|
|||
public OPushSchemaRequest(ODocument schema) { | |||
this.schema = schema; | |||
} | |||
|
|||
@Override | |||
public void write(OChannelDataOutput channel) throws IOException { | |||
channel.writeBytes(ORecordSerializerNetworkV37.INSTANCE.toStream(schema, false)); | |||
} | |||
|
|||
@Override | |||
public void read(OChannelDataInput network) throws IOException { | |||
byte[] bytes = network.readBytes(); | |||
this.schema = (ODocument) ORecordSerializerNetworkV37.INSTANCE.fromStream(bytes, null, null); | |||
} | |||
|
|||
@Override | |||
public OBinaryPushResponse execute(ORemotePushHandler pushHandler) { | |||
return pushHandler.executeUpdateSchema(this); | |||
} | |||
|
|||
@Override | |||
public OBinaryPushResponse createResponse() { | |||
return null; | |||
} | |||
|
|||
@Override | |||
public byte getPushCommand() { | |||
return REQUEST_PUSH_SCHEMA; | |||
} | |||
|
|||
public ODocument getSchema() { | |||
return schema; | |||
} | |||
} |
56 changes: 56 additions & 0 deletions
56
.../com/orientechnologies/orient/client/remote/message/OPushStorageConfigurationRequest.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 | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,56 @@ | |||
package com.orientechnologies.orient.client.remote.message; | |||
|
|||
import com.orientechnologies.orient.client.remote.ORemotePushHandler; | |||
import com.orientechnologies.orient.client.remote.message.OBinaryPushRequest; | |||
import com.orientechnologies.orient.client.remote.message.OBinaryPushResponse; | |||
import com.orientechnologies.orient.client.remote.message.OPushDistributedConfigurationRequest; | |||
import com.orientechnologies.orient.client.remote.message.push.OStorageConfigurationPayload; | |||
import com.orientechnologies.orient.core.config.OStorageConfiguration; | |||
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataInput; | |||
import com.orientechnologies.orient.enterprise.channel.binary.OChannelDataOutput; | |||
|
|||
import java.io.IOException; | |||
|
|||
import static com.orientechnologies.orient.enterprise.channel.binary.OChannelBinaryProtocol.REQUEST_PUSH_STORAGE_CONFIG; | |||
|
|||
public class OPushStorageConfigurationRequest implements OBinaryPushRequest<OBinaryPushResponse> { | |||
|
|||
private OStorageConfigurationPayload payload; | |||
|
|||
public OPushStorageConfigurationRequest() { | |||
payload = new OStorageConfigurationPayload(); | |||
} | |||
|
|||
public OPushStorageConfigurationRequest(OStorageConfiguration configuration) { | |||
payload = new OStorageConfigurationPayload(configuration); | |||
} | |||
|
|||
@Override | |||
public void write(OChannelDataOutput channel) throws IOException { | |||
payload.write(channel); | |||
} | |||
|
|||
@Override | |||
public void read(OChannelDataInput network) throws IOException { | |||
payload.read(network); | |||
} | |||
|
|||
@Override | |||
public OBinaryPushResponse execute(ORemotePushHandler pushHandler) { | |||
return pushHandler.executeUpdateStorageConfig(this); | |||
} | |||
|
|||
@Override | |||
public OBinaryPushResponse createResponse() { | |||
return null; | |||
} | |||
|
|||
@Override | |||
public byte getPushCommand() { | |||
return REQUEST_PUSH_STORAGE_CONFIG; | |||
} | |||
|
|||
public OStorageConfigurationPayload getPayload() { | |||
return payload; | |||
} | |||
} |
Oops, something went wrong.