Skip to content

Commit

Permalink
Merge pull request #207 from infinistor/1.3.1-beta
Browse files Browse the repository at this point in the history
1.3.1 Release
  • Loading branch information
jssinn authored Oct 6, 2023
2 parents 043b099 + 6467ecd commit e4bc2d0
Show file tree
Hide file tree
Showing 197 changed files with 10,462 additions and 7,037 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ KSAN은 AWS S3 호환 API를 기본적으로 제공하고 개발 로드맵에

ℹ️ Microsoft Azure API 및 Google Cloud API는 각각 2022년, 2023년에 단계적으로 지원할 예정입니다.

ℹ️ Microsoft Azure API는 v1.2.0부터 지원합니다. Google Cloud API는 v1.4.0부터 상호호환성을 제공할 예정입니다.
ℹ️ Microsoft Azure API는 v1.2.0부터 지원합니다. Google Cloud API는 v1.3.1부터 지원합니다.

<br><br>

Expand Down Expand Up @@ -87,7 +87,7 @@ KSAN 시스템은 메타데이터를 관리하기 위해 MariaDB와 같은 RDBMS

---

⚠️ 이 프로젝트는 아직 상업적 제품 제작에 적합한 단계가 아닙니다. 2023년 상반기 중에 상업적 이용에 적합한 수준에 도달하는 것을 목표로 하고 있습니다.
⚠️ 이 프로젝트는 아직 상업적 제품 제작에 적합한 단계가 아닙니다. 2023년 하반기 중에 상업적 이용에 적합한 수준에 도달하는 것을 목표로 하고 있습니다.

ℹ️ 이 프로젝트를 교육 및 연구목적에 적합한 단계입니다. 교육에 활용하는 경우 연락해주시면 필요에 따라 기술지원을 제공해 드리겠습니다.

Expand Down
21 changes: 16 additions & 5 deletions core/backend/src/com/pspace/backend/libs/Data/Constants.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@

public class Constants {
public static final String AGENT_CONF_PATH = "/usr/local/ksan/etc/ksanAgent.conf";
public static final String LIFECYCLE_MANAGER_SERVICE_ID_PATH = "/usr/local/ksan/sbin/.ksanLifecycleManager.ServiceId";
public static final String LOG_MANAGER_SERVICE_ID_PATH = "/usr/local/ksan/sbin/.ksanLogManager.ServiceId";
public static final String REPLICATION_MANAGER_SERVICE_ID_PATH = "/usr/local/ksan/sbin/.ksanReplicationManager.ServiceId";
public static final String LIFECYCLE_MANAGER_SERVICE_ID_PATH = "/usr/local/ksan/etc/ksanLifecycleManager.ServiceId";
public static final String LOG_MANAGER_SERVICE_ID_PATH = "/usr/local/ksan/etc/ksanLogManager.ServiceId";
public static final String REPLICATION_MANAGER_SERVICE_ID_PATH = "/usr/local/ksan/etc/ksanReplicationManager.ServiceId";

public static final String MQ_KSAN_SYSTEM_EXCHANGE = "ksan.system";
public static final String MQ_KSAN_LOG_EXCHANGE = "ksan.log";

public static final String MQ_HEARTBEAT_BINDING_KEY = "*.services.state";

/***********************************
Expand Down Expand Up @@ -52,7 +52,6 @@ public class Constants {
public static final String MQ_BINDING_REPLICATION_LOG = "*.services.replication.log.add";

public static final String MQ_EXCHANGE_OPTION_DIRECT = "direct";
public static final String MQ_EXCHANGE_OPTION_FANOUT = "fanout";
public static final String MQ_EXCHANGE_OPTION_TOPIC = "topic";

public static final String EM_S3_NOT_WORKING = "This S3 does not work!";
Expand All @@ -63,4 +62,16 @@ public class Constants {
public static final String MQ_QUEUE_NAME(String QueueName, String ServiceId) {
return QueueName + "-" + ServiceId;
}

/***********************************
* Portal Manager
***********************************/
public static final String URL_CONFIG = "/api/v1/Config";
public static final String URL_OBJ_MANAGER_CONFIG = URL_CONFIG + "/KsanObjManager";
public static final String URL_REPLICATION_MANAGER_CONFIG = URL_CONFIG + "/KsanReplicationManager";
public static final String URL_LIFECYCLE_MANAGER_CONFIG = URL_CONFIG + "/KsanLifecycleManager";
public static final String URL_LOG_MANAGER_CONFIG = URL_CONFIG + "/KsanLogManager";

public static final String URL_REGION = "/api/v1/Regions";
public static final String URL_LOCAL_REGION = URL_REGION + "/Default";
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,40 @@ public String toString() {
return "";
}
}


public static class Builder{
private String bucketName;
private String objectName;
private String versionId;
private String storageClass;
private String uploadId;

public Builder(String bucketName, String objectName) {
this.bucketName = bucketName;
this.objectName = objectName;
this.versionId = "";
this.storageClass = "";
this.uploadId = "";
}

public Builder setVersionId(String versionId) {
this.versionId = versionId;
return this;
}

public Builder setStorageClass(String storageClass) {
this.storageClass = storageClass;
return this;
}

public Builder setUploadId(String uploadId) {
this.uploadId = uploadId;
return this;
}

public LifecycleEventData build() {
return new LifecycleEventData(bucketName, objectName, versionId, storageClass, uploadId);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public LifecycleLogData() {

public LifecycleLogData(LifecycleEventData data, String message) {
super(data);
this.date = Utility.GetNowTime();
this.date = Utility.getNowTime();
this.message = message;
}

Expand Down
38 changes: 17 additions & 21 deletions core/backend/src/com/pspace/backend/libs/Data/S3/S3ObjectData.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,53 +25,49 @@
public class S3ObjectData {
final Logger logger = LoggerFactory.getLogger(S3ObjectData.class);

public String ObjectName;
public String objectName;
public String versionId;
public long size;
public Collection<Tag> tags;

public Boolean isTagSet;

public S3ObjectData(String ObjectName, String VersionId) {
this.ObjectName = ObjectName;
this.versionId = VersionId;
setTags(null);
}

public S3ObjectData(String ObjectName, String VersionId, String StrTags) {
this.ObjectName = ObjectName;
this.versionId = VersionId;
setTags(StrTags);
public S3ObjectData(String objectName, String versionId, long size, String strTags) {
this.objectName = objectName;
this.versionId = versionId;
this.size = size;
setTags(strTags);
}

public S3ObjectData(Metadata Data) {
this.ObjectName = Data.getPath();
this.objectName = Data.getPath();
this.versionId = Data.getVersionId();
setTags(Data.getTag());
}

public Boolean setTags(String StrTagging) {
if (StringUtils.isBlank(StrTagging)) {
public Boolean setTags(String strTagging) {
if (StringUtils.isBlank(strTagging)) {
isTagSet = false;
return false;
}
try {
// Tag 언마샬링
var MyTags = new XmlMapper().readValue(StrTagging, Tagging.class);
if (MyTags == null)
var myTags = new XmlMapper().readValue(strTagging, Tagging.class);
if (myTags == null)
return false;
if (MyTags.tags == null)
if (myTags.tags == null)
return false;
if (MyTags.tags.tags == null)
if (myTags.tags.tags == null)
return false;
if (MyTags.tags.tags.size() == 0)
if (myTags.tags.tags.size() == 0)
return false;

for (var MyTag : MyTags.tags.tags)
for (var MyTag : myTags.tags.tags)
tags.add(MyTag);
isTagSet = true;
return true;
} catch (Exception e) {
logger.error("Object info read failed : {}", StrTagging, e);
logger.error("Object info read failed : {}", strTagging, e);
return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.pspace.backend.libs.Utility;
import com.pspace.backend.libs.Data.Constants;
import com.pspace.ifs.ksan.libs.mq.MQSender;

Expand All @@ -37,7 +38,7 @@ public void Start(int Delay) {

while (!Stop) {
try {
Thread.sleep(Delay);
Utility.delay(Delay);
Sender.send(Request.toString(), Constants.MQ_HEARTBEAT_BINDING_KEY);
} catch (Exception e) {
logger.error("", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,61 @@
*/
package com.pspace.backend.libs.Ksan.Data;

import com.amazonaws.services.s3.AmazonS3;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.pspace.backend.libs.Utility;

public class S3RegionData {
public String Name;
public String Address;
public int Port;
public int SSLPort;
public String AccessKey;
public String SecretKey;
@JsonProperty("Name")
public String name;
@JsonProperty("Address")
public String address;
@JsonProperty("Port")
public int port;
@JsonProperty("SSLPort")
public int sslPort;
@JsonProperty("AccessKey")
public String accessKey;
@JsonProperty("SecretKey")
public String secretKey;

@JsonIgnore
public AmazonS3 client;

public void setClient() {
client = Utility.createClient(this);
}

public S3RegionData(String Name, String Address, int Port, int SSLPort, String AccessKey, String SecretKey) {
this.Name = Name;
this.Address = Address;
this.Port = Port;
this.SSLPort = SSLPort;
this.AccessKey = AccessKey;
this.SecretKey = SecretKey;
this.name = Name;
this.address = Address;
this.port = Port;
this.sslPort = SSLPort;
this.accessKey = AccessKey;
this.secretKey = SecretKey;
setClient();
}
public S3RegionData(ResponseRegion Data) {
this.Name = Data.Name;
this.Address = Data.Address;
this.Port = Data.Port;
this.SSLPort = Data.SSLPort;
this.AccessKey = Data.AccessKey;
this.SecretKey = Data.SecretKey;
this.name = Data.Name;
this.address = Data.Address;
this.port = Data.Port;
this.sslPort = Data.SSLPort;
this.accessKey = Data.AccessKey;
this.secretKey = Data.SecretKey;
setClient();
}

public void init() {
Name = "";
Address = "";
Port = 0;
SSLPort = 0;
AccessKey = "";
SecretKey = "";
public void update(S3RegionData Data) {
name = Data.name;
address = Data.address;
port = Data.port;
sslPort = Data.sslPort;
accessKey = Data.accessKey;
secretKey = Data.secretKey;
setClient();
}

@Override
Expand All @@ -53,15 +73,15 @@ public String toString() {
try {
return mapper.writeValueAsString(this);
} catch (JsonProcessingException e) {
return "";
return super.toString();
}
}

public String getHttpURL() {
return String.format("http://%s:%d", Address, Port);
return String.format("http://%s:%d", address, port);
}

public String getHttpsURL() {
return String.format("https://%s:%d", Address, SSLPort);
return String.format("https://%s:%d", address, sslPort);
}
}
Loading

0 comments on commit e4bc2d0

Please sign in to comment.