未验证 提交 730a09be 编写于 作者: T ThreadDao 提交者: GitHub

[skip ci] add assert by collection stats (#3437)

Signed-off-by: Nzongyufen <zongyufen@foxmail.com>
上级 41f844f8
......@@ -21,7 +21,6 @@ public class MainClass {
private static String HOST = "127.0.0.1";
private static int PORT = 19530;
private int segmentRowCount = 5000;
public int dimension = 128;
private static ConnectParam CONNECT_PARAM = new ConnectParam.Builder()
.withHost(HOST)
.withPort(PORT)
......@@ -69,7 +68,7 @@ public class MainClass {
private Object[][] genCollection(boolean isBinary, boolean autoId) throws ConnectFailedException {
Object[][] collection;
String collectionName = Utils.genUniqueStr("collection");
List<Map<String, Object>> defaultFields = Utils.genDefaultFields(dimension, isBinary);
List<Map<String, Object>> defaultFields = Utils.genDefaultFields(Constants.dimension,isBinary);
String jsonParams = String.format("{\"segment_row_count\": %s, \"auto_id\": %s}",segmentRowCount, autoId);
// Generate connection instance
MilvusClient client = new MilvusGrpcClient();
......
package com;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.milvus.client.*;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.util.List;
public class TestCompact {
int nb = Constants.nb;
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testCompactAfterDelete(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
......@@ -16,11 +20,13 @@ public class TestCompact {
Response res_delete = client.deleteEntityByID(collectionName, ids);
assert(res_delete.ok());
client.flush(collectionName);
CompactParam compactParam = new CompactParam.Builder(collectionName)
.withThreshold(0.3)
.build();
CompactParam compactParam = new CompactParam.Builder(collectionName).build();
Response res_compact = client.compact(compactParam);
assert(res_compact.ok());
Response statsResponse = client.getCollectionStats(collectionName);
assert (statsResponse.ok());
JSONObject jsonObject = JSONObject.parseObject(statsResponse.getMessage());
Assert.assertEquals(jsonObject.getIntValue("data_size"), 0);
Assert.assertEquals(client.countEntities(collectionName).getCollectionEntityCount(), 0);
}
......@@ -34,31 +40,48 @@ public class TestCompact {
Response res_delete = client.deleteEntityByID(collectionName, ids);
assert(res_delete.ok());
client.flush(collectionName);
CompactParam compactParam = new CompactParam.Builder(collectionName)
.withThreshold(0.3)
.build();
CompactParam compactParam = new CompactParam.Builder(collectionName).build();
Response res_compact = client.compact(compactParam);
assert(res_compact.ok());
Response statsResponse = client.getCollectionStats(collectionName);
assert (statsResponse.ok());
JSONObject jsonObject = JSONObject.parseObject(statsResponse.getMessage());
Assert.assertEquals(jsonObject.getIntValue("data_size"), 0);
Assert.assertEquals(client.countEntities(collectionName).getCollectionEntityCount(), 0);
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testCompactNoCollection(MilvusClient client, String collectionName) {
String name = "";
CompactParam compactParam = new CompactParam.Builder(name)
.withThreshold(0.3)
.build();
CompactParam compactParam = new CompactParam.Builder(name).build();
Response res_compact = client.compact(compactParam);
assert(!res_compact.ok());
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testCompactEmptyCollection(MilvusClient client, String collectionName) {
CompactParam compactParam = new CompactParam.Builder(collectionName)
.withThreshold(0.3)
.build();
CompactParam compactParam = new CompactParam.Builder(collectionName).build();
Response res_compact = client.compact(compactParam);
assert(res_compact.ok());
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testCompactThresholdLessThanDeleted(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
client.flush(collectionName);
Response deleteRes = client.deleteEntityByID(collectionName, res.getEntityIds().subList(0, nb/4));
assert (deleteRes.ok());
client.flush(collectionName);
Response resBefore = client.getCollectionStats(collectionName);
JSONObject segmentsBefore = (JSONObject)Utils.parseJsonArray(resBefore.getMessage(), "segments").get(0);
CompactParam compactParam = new CompactParam.Builder(collectionName).withThreshold(0.3).build();
Response resCompact = client.compact(compactParam);
assert (resCompact.ok());
Response resAfter = client.getCollectionStats(collectionName);
JSONObject segmentsAfter = (JSONObject)Utils.parseJsonArray(resAfter.getMessage(), "segments").get(0);
Assert.assertEquals(segmentsBefore.get("data_size"), segmentsAfter.get("data_size"));
}
}
......@@ -14,7 +14,7 @@ import java.util.stream.LongStream;
public class TestDeleteEntities {
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testDeleteVectors(MilvusClient client, String collectionName) {
public void testDeleteEntities(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
......@@ -28,7 +28,7 @@ public class TestDeleteEntities {
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testDeleteSingleVector(MilvusClient client, String collectionName) {
public void testDeleteSingleEntity(MilvusClient client, String collectionName) {
List<List<Float>> del_vector = new ArrayList<>();
del_vector.add(Constants.vectors.get(0));
List<Long> del_ids = new ArrayList<>();
......@@ -50,7 +50,7 @@ public class TestDeleteEntities {
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testDeleteVectorsCollectionNotExisted(MilvusClient client, String collectionName) {
public void testDeleteEntitiesCollectionNotExisted(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
......@@ -62,7 +62,7 @@ public class TestDeleteEntities {
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testDeleteVectorsEmptyCollection(MilvusClient client, String collectionName) {
public void testDeleteEntitiesEmptyCollection(MilvusClient client, String collectionName) {
String collectionNameNew = Utils.genUniqueStr(collectionName);
List<Long> entityIds = LongStream.range(0, Constants.nb).boxed().collect(Collectors.toList());
Response res_delete = client.deleteEntityByID(collectionNameNew, entityIds);
......@@ -70,7 +70,7 @@ public class TestDeleteEntities {
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void test_delete_vector_id_not_existed(MilvusClient client, String collectionName) {
public void testDeleteEntityIdNotExisted(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
......@@ -87,7 +87,7 @@ public class TestDeleteEntities {
// Below tests binary vectors
@Test(dataProvider = "BinaryCollection", dataProviderClass = MainClass.class)
public void test_delete_vectors_binary(MilvusClient client, String collectionName) {
public void testDeleteEntitiesBinary(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultBinaryEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
......
package com;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.milvus.client.*;
import org.testng.Assert;
import org.testng.annotations.Test;
import java.nio.ByteBuffer;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class TestIndex {
......@@ -17,7 +16,13 @@ public class TestIndex {
Index index = new Index.Builder(collectionName, Constants.floatFieldName).withParamsInJson(Constants.indexParam).build();
Response res_create = client.createIndex(index);
assert(res_create.ok());
Response statsResponse = client.getCollectionStats(collectionName);
// TODO: should check getCollectionStats
if(statsResponse.ok()) {
JSONArray filesJsonArray = Utils.parseJsonArray(statsResponse.getMessage(), "files");
filesJsonArray.stream().map(item-> (JSONObject)item).filter(item->item.containsKey("index_type")).forEach(file->
Assert.assertEquals(file.get("index_type"), Constants.indexType));
}
}
@Test(dataProvider = "BinaryCollection", dataProviderClass = MainClass.class)
......@@ -27,6 +32,13 @@ public class TestIndex {
Index index = new Index.Builder(collectionName, Constants.binaryFieldName).withParamsInJson(Constants.binaryIndexParam).build();
Response res_create = client.createIndex(index);
assert(res_create.ok());
Response statsResponse = client.getCollectionStats(collectionName);
// TODO: should check getCollectionStats
if(statsResponse.ok()) {
JSONArray filesJsonArray = Utils.parseJsonArray(statsResponse.getMessage(), "files");
filesJsonArray.stream().map(item-> (JSONObject)item).filter(item->item.containsKey("index_type")).forEach(file->
Assert.assertEquals(file.get("index_type"), Constants.defaultBinaryIndexType));
}
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
......@@ -91,9 +103,16 @@ public class TestIndex {
Index index = new Index.Builder(collectionName, Constants.floatFieldName).withParamsInJson(Constants.indexParam).build();
Response res_create = client.createIndex(index);
assert(res_create.ok());
// Response res_drop = client.dropIndex(collectionName, Constants.floatFieldName);
// assert(res_drop.ok());
// TODO: getCollectionStats
Response res_drop = client.dropIndex(collectionName, Constants.floatFieldName);
assert(res_drop.ok());
Response statsResponse = client.getCollectionStats(collectionName);
// TODO: should check getCollectionStats
if(statsResponse.ok()) {
JSONArray filesJsonArray = Utils.parseJsonArray(statsResponse.getMessage(), "files");
filesJsonArray.stream().map(item -> (JSONObject) item).forEach(file->{
assert (!file.containsKey("index_type"));
});
}
}
@Test(dataProvider = "BinaryCollection", dataProviderClass = MainClass.class)
......@@ -103,22 +122,29 @@ public class TestIndex {
Index index = new Index.Builder(collectionName, Constants.binaryFieldName).withParamsInJson(Constants.binaryIndexParam).build();
Response res_create = client.createIndex(index);
assert(res_create.ok());
// Response res_drop = client.dropIndex(collectionName, Constants.binaryFieldName);
// assert(res_drop.ok());
// TODO: getCollectionStats
Response res_drop = client.dropIndex(collectionName, Constants.binaryFieldName);
assert(res_drop.ok());
Response statsResponse = client.getCollectionStats(collectionName);
// TODO: should check getCollectionStats
if(statsResponse.ok()) {
JSONArray filesJsonArray = Utils.parseJsonArray(statsResponse.getMessage(), "files");
filesJsonArray.stream().map(item -> (JSONObject) item).forEach(file->{
assert (!file.containsKey("index_type"));
});
}
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testDropIndexTableNotExisted(MilvusClient client, String collectionName) {
String collectionNameNew = Utils.genUniqueStr(collectionName);
// Response res_drop = client.dropIndex(collectionNameNew, Constants.floatFieldName);
// assert(!res_drop.ok());
Response res_drop = client.dropIndex(collectionNameNew, Constants.floatFieldName);
assert(!res_drop.ok());
}
@Test(dataProvider = "DisConnectInstance", dataProviderClass = MainClass.class)
public void testDropIndexWithoutConnect(MilvusClient client, String collectionName) {
// Response res_drop = client.dropIndex(collectionNameNew, Constants.floatFieldName);
// assert(!res_drop.ok());
Response res_drop = client.dropIndex(collectionName, Constants.floatFieldName);
assert(!res_drop.ok());
}
}
package com;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import io.milvus.client.*;
import org.apache.commons.lang3.RandomStringUtils;
import org.testng.Assert;
......@@ -11,33 +13,29 @@ import java.util.stream.Collectors;
import java.util.stream.LongStream;
public class TestInsertEntities {
int dimension = 128;
int dimension = Constants.dimension;
String tag = "tag";
int nb = 8000;
List<List<Float>> vectors = Utils.genVectors(nb, dimension, true);
List<ByteBuffer> vectorsBinary = Utils.genBinaryVectors(nb, dimension);
List<Map<String,Object>> defaultEntities = Utils.genDefaultEntities(dimension,nb,vectors);
List<Map<String,Object>> defaultBinaryEntities = Utils.genDefaultBinaryEntities(dimension,nb,vectorsBinary);
int nb = Constants.nb;
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testInsertEntitiesCollectionNotExisted(MilvusClient client, String collectionName) throws InterruptedException {
public void testInsertEntitiesCollectionNotExisted(MilvusClient client, String collectionName) {
String collectionNameNew = collectionName + "_";
InsertParam insertParam = new InsertParam.Builder(collectionNameNew)
.withFields(defaultEntities).build();
.withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
}
@Test(dataProvider = "DisConnectInstance", dataProviderClass = MainClass.class)
public void testInsertEntitiesWithoutConnect(MilvusClient client, String collectionName) throws InterruptedException {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultEntities).build();
public void testInsertEntitiesWithoutConnect(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testInsertEntities(MilvusClient client, String collectionName) {
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultEntities).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
Response res_flush = client.flush(collectionName);
......@@ -51,14 +49,15 @@ public class TestInsertEntities {
// Add vectors with ids
List<Long> entityIds = LongStream.range(0, nb).boxed().collect(Collectors.toList());
InsertParam insertParam = new InsertParam.Builder(collectionName)
.withFields(defaultEntities)
.withFields(Constants.defaultEntities)
.withEntityIds(entityIds)
.build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
Response res_flush = client.flush(collectionName);
assert(res_flush.ok());
// Assert collection row count
// Assert ids and collection row count
Assert.assertEquals(res.getEntityIds(), entityIds);
Assert.assertEquals(client.countEntities(collectionName).getCollectionEntityCount(), nb);
}
......@@ -66,29 +65,23 @@ public class TestInsertEntities {
public void testInsertEntityWithInvalidIds(MilvusClient client, String collectionName) {
// Add vectors with ids
List<Long> entityIds = LongStream.range(0, nb+1).boxed().collect(Collectors.toList());
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultEntities).withEntityIds(entityIds).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).withEntityIds(entityIds).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
}
// @Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
// public void testInsertEntityWithInvalidDimension(MilvusClient client, String collectionName) {
//// vectors.get(0).add((float) 0);
// List<Map<String,Object>> entities = Utils.genDefaultEntities(dimension+1,nb,vectors);
// InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(entities).build();
// InsertResponse res = client.insert(insertParam);
// assert(!res.getResponse().ok());
// }
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testInsertEntityWithInvalidDimension(MilvusClient client, String collectionName) {
List<List<Float>> vectors = Utils.genVectors(nb, dimension+1, true);
List<Map<String,Object>> entities = Utils.genDefaultEntities(dimension+1,nb,vectors);
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(entities).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
}
@Test(dataProvider = "Collection", dataProviderClass = MainClass.class)
public void testInsertEntityWithInvalidVectors(MilvusClient client, String collectionName) {
// vectors.set(0, new ArrayList<>());
List<Map<String,Object>> invalidEntities = Utils.genDefaultEntities(dimension,nb,new ArrayList<>());
invalidEntities.forEach(entity ->{
if("float_vector".equals(entity.get("field"))){
entity.put("values",new ArrayList<>());
}
});
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(invalidEntities).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
......@@ -100,13 +93,20 @@ public class TestInsertEntities {
public void testInsertEntityPartition(MilvusClient client, String collectionName) {
Response createpResponse = client.createPartition(collectionName, tag);
assert(createpResponse.ok());
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultEntities).withPartitionTag(tag).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).withPartitionTag(tag).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
Response res_flush = client.flush(collectionName);
assert(res_flush.ok());
// Assert collection row count
Assert.assertEquals(client.countEntities(collectionName).getCollectionEntityCount(), nb);
Response statsResponse = client.getCollectionStats(collectionName);
if(statsResponse.ok()) {
JSONArray partitionsJsonArray = Utils.parseJsonArray(statsResponse.getMessage(), "partitions");
partitionsJsonArray.stream().map(item -> (JSONObject) item).filter(item->item.containsValue(tag)).forEach(obj -> {
Assert.assertEquals(obj.get("row_count"), nb);
Assert.assertEquals(obj.get("tag"), tag);
});
}
}
// Add vectors into collection, which tag not existed
......@@ -115,7 +115,7 @@ public class TestInsertEntities {
Response createpResponse = client.createPartition(collectionName, tag);
assert(createpResponse.ok());
String tag = RandomStringUtils.randomAlphabetic(10);
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultEntities).withPartitionTag(tag).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultEntities).withPartitionTag(tag).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
}
......@@ -124,19 +124,26 @@ public class TestInsertEntities {
@Test(dataProvider = "BinaryCollection", dataProviderClass = MainClass.class)
public void testInsertEntityPartitionABinary(MilvusClient client, String collectionName) {
Response createpResponse = client.createPartition(collectionName, tag);
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultBinaryEntities).withPartitionTag(tag).build();
assert (createpResponse.ok());
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultBinaryEntities).withPartitionTag(tag).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
Response res_flush = client.flush(collectionName);
assert(res_flush.ok());
// Assert collection row count
Assert.assertEquals(client.countEntities(collectionName).getCollectionEntityCount(), nb);
Response statsResponse = client.getCollectionStats(collectionName);
if(statsResponse.ok()) {
JSONArray partitionsJsonArray = Utils.parseJsonArray(statsResponse.getMessage(), "partitions");
partitionsJsonArray.stream().map(item -> (JSONObject) item).filter(item->item.containsValue(tag)).forEach(obj -> {
Assert.assertEquals(obj.get("tag"), tag);
Assert.assertEquals(obj.get("row_count"), nb);
});
}
}
@Test(dataProvider = "BinaryCollection", dataProviderClass = MainClass.class)
public void testInsertEntityBinary(MilvusClient client, String collectionName) {
System.out.println(collectionName);
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultBinaryEntities).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultBinaryEntities).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
Response res_flush = client.flush(collectionName);
......@@ -149,12 +156,13 @@ public class TestInsertEntities {
public void testInsertBinaryEntityWithIds(MilvusClient client, String collectionName) {
// Add vectors with ids
List<Long> entityIds = LongStream.range(0, nb).boxed().collect(Collectors.toList());
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultBinaryEntities).withEntityIds(entityIds).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultBinaryEntities).withEntityIds(entityIds).build();
InsertResponse res = client.insert(insertParam);
assert(res.getResponse().ok());
Response res_flush = client.flush(collectionName);
assert(res_flush.ok());
// Assert collection row count
Assert.assertEquals(entityIds, res.getEntityIds());
Assert.assertEquals(client.countEntities(collectionName).getCollectionEntityCount(), nb);
}
......@@ -162,7 +170,7 @@ public class TestInsertEntities {
public void testInsertBinaryEntityWithInvalidIds(MilvusClient client, String collectionName) {
// Add vectors with ids
List<Long> invalidEntityIds = LongStream.range(0, nb+1).boxed().collect(Collectors.toList());
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(defaultBinaryEntities).withEntityIds(invalidEntityIds).build();
InsertParam insertParam = new InsertParam.Builder(collectionName).withFields(Constants.defaultBinaryEntities).withEntityIds(invalidEntityIds).build();
InsertResponse res = client.insert(insertParam);
assert(!res.getResponse().ok());
}
......
......@@ -9,6 +9,7 @@ import org.apache.commons.lang3.RandomStringUtils;
import java.nio.ByteBuffer;
import java.util.*;
import java.util.stream.Collectors;
import java.util.stream.Stream;
public class Utils {
......@@ -89,8 +90,6 @@ public class Utils {
List<Map<String,Object>> fieldsMap = genDefaultFields(dimension, false);
List<Long> intValues = new ArrayList<>(vectorCount);
List<Float> floatValues = new ArrayList<>(vectorCount);
// List<List<Float>> vectors = genVectors(vectorCount,dimension,false);
// List<ByteBuffer> binaryVectors = genBinaryVectors(vectorCount,dimension);
for (int i = 0; i < vectorCount; ++i) {
intValues.add((long) i);
floatValues.add((float) i);
......@@ -225,4 +224,19 @@ public class Utils {
});
return vector;
}
public static JSONArray parseJsonArray(String message, String type) {
JSONObject jsonObject = JSONObject.parseObject(message);
JSONArray partitionsJsonArray = jsonObject.getJSONArray("partitions");
if ("partitions".equals(type))
return partitionsJsonArray;
JSONArray segmentsJsonArray = ((JSONObject)partitionsJsonArray.get(0)).getJSONArray("segments");
if ("segments".equals(type))
return segmentsJsonArray;
JSONArray filesJsonArray = ((JSONObject)segmentsJsonArray.get(0)).getJSONArray("files");
if ("files".equals(type))
return filesJsonArray;
throw new RuntimeException("unsupported type");
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册