Skip to content

Commit f459c5c

Browse files
committed
One more rename
for f in $(ack -i kuzu --ignore-dir build --ignore-dir test/answers --ignore-dir dataset -l); do sed -i -e 's/kuzu/lbug/g' -e 's/Kuzu/Lbug/g' -e 's/KUZU/LBUG/g' $f; done
1 parent 25faa2b commit f459c5c

6 files changed

Lines changed: 46 additions & 46 deletions

File tree

src/main/java/com/lbugdb/Database.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
package com.lbugdb;
22

33
/**
4-
* The Database class is the main class of KuzuDB. It manages all database
4+
* The Database class is the main class of LbugDB. It manages all database
55
* components.
66
*/
77
public class Database implements AutoCloseable {

src/main/java/com/lbugdb/LbugList.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.lbugdb;
22

3-
public class KuzuList implements AutoCloseable {
3+
public class LbugList implements AutoCloseable {
44
private Value listVal;
55

66
/**
@@ -15,7 +15,7 @@ public Value getValue() {
1515
*
1616
* @param value the value to construct the list from
1717
*/
18-
public KuzuList(Value value) {
18+
public LbugList(Value value) {
1919
listVal = value;
2020
}
2121

@@ -24,7 +24,7 @@ public KuzuList(Value value) {
2424
*
2525
* @param values: the array to construct the list from
2626
*/
27-
public KuzuList(Value[] values) {
27+
public LbugList(Value[] values) {
2828
listVal = Native.lbugCreateList(values);
2929
}
3030

@@ -33,7 +33,7 @@ public KuzuList(Value[] values) {
3333
*
3434
* @param numElements: the size of the list to construct
3535
*/
36-
public KuzuList(DataType type, long numElements) {
36+
public LbugList(DataType type, long numElements) {
3737
listVal = Native.lbugCreateList(type, numElements);
3838
}
3939

src/main/java/com/lbugdb/LbugMap.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.lbugdb;
22

3-
public class KuzuMap implements AutoCloseable {
3+
public class LbugMap implements AutoCloseable {
44
private Value mapVal;
55

66
/**
@@ -15,7 +15,7 @@ public Value getValue() {
1515
*
1616
* @param value the value to construct the map from
1717
*/
18-
public KuzuMap(Value value) {
18+
public LbugMap(Value value) {
1919
mapVal = value;
2020
}
2121

@@ -26,7 +26,7 @@ public KuzuMap(Value value) {
2626
* @param keys: The keys in the map
2727
* @param values: The values in the map
2828
*/
29-
public KuzuMap(Value[] keys, Value[] values) {
29+
public LbugMap(Value[] keys, Value[] values) {
3030
if (keys.length != values.length) {
3131
mapVal = null;
3232
return;
@@ -43,7 +43,7 @@ private Value getMapKeyOrValue(long index, boolean isKey) {
4343
return null;
4444
}
4545
Value structValue = Native.lbugValueGetListElement(mapVal, index);
46-
Value keyOrValue = new KuzuList(structValue).getListElement(isKey ? 0 : 1);
46+
Value keyOrValue = new LbugList(structValue).getListElement(isKey ? 0 : 1);
4747
structValue.close();
4848
return keyOrValue;
4949
}

src/main/java/com/lbugdb/LbugStruct.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import java.util.HashMap;
44
import java.util.Map;
55

6-
public class KuzuStruct implements AutoCloseable {
6+
public class LbugStruct implements AutoCloseable {
77
private Value structVal;
88

99
/**
@@ -18,7 +18,7 @@ public Value getValue() {
1818
*
1919
* @param value the value to construct the struct from
2020
*/
21-
public KuzuStruct(Value value) {
21+
public LbugStruct(Value value) {
2222
structVal = value;
2323
}
2424

@@ -29,7 +29,7 @@ public KuzuStruct(Value value) {
2929
* @param fields: The fields of the struct, with the keys representing the field
3030
* names and the values representing the field values.
3131
*/
32-
public KuzuStruct(Map<String, Value> fields) {
32+
public LbugStruct(Map<String, Value> fields) {
3333
if (fields.isEmpty()) {
3434
structVal = null;
3535
return;
@@ -55,7 +55,7 @@ public KuzuStruct(Map<String, Value> fields) {
5555
* @param fieldNames: The name of the struct fields
5656
* @param fieldValues: The values of the struct fields
5757
*/
58-
public KuzuStruct(String[] fieldNames, Value[] fieldValues) {
58+
public LbugStruct(String[] fieldNames, Value[] fieldValues) {
5959
if (fieldNames.length != fieldValues.length) {
6060
structVal = null;
6161
return;

src/main/java/com/lbugdb/ValueRecursiveRelUtil.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ public class ValueRecursiveRelUtil {
1313
* destroyed.
1414
*/
1515
public static Value getNodeList(Value value) {
16-
return new KuzuStruct(value).getValueByIndex(0);
16+
return new LbugStruct(value).getValueByIndex(0);
1717
}
1818

1919
/**
@@ -25,6 +25,6 @@ public static Value getNodeList(Value value) {
2525
* destroyed.
2626
*/
2727
public static Value getRelList(Value value) {
28-
return new KuzuStruct(value).getValueByIndex(1);
28+
return new LbugStruct(value).getValueByIndex(1);
2929
}
3030
}

src/test/java/com/lbugdb/ValueTest.java

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ void ValueCopy() {
350350
@Test
351351
void CreateListLiteral() {
352352
Value[] listValues = { new Value(1), new Value(2), new Value(3) };
353-
KuzuList list = new KuzuList(listValues);
353+
LbugList list = new LbugList(listValues);
354354
Value[] listAsArray = list.toArray();
355355
assertEquals(listValues.length, list.getListSize());
356356
for (int i = 0; i < list.getListSize(); ++i) {
@@ -382,13 +382,13 @@ void CreateListLiteral() {
382382
void CreateListLiteralNested() {
383383
Value[][] nestedListValues = { { new Value(1), new Value(2), new Value(3) },
384384
{ new Value(4), new Value(5), new Value(6) } };
385-
KuzuList[] nestedLists = { new KuzuList(nestedListValues[0]), new KuzuList(nestedListValues[1]) };
385+
LbugList[] nestedLists = { new LbugList(nestedListValues[0]), new LbugList(nestedListValues[1]) };
386386

387387
Value[] listValues = { nestedLists[0].getValue(), nestedLists[1].getValue() };
388-
KuzuList list = new KuzuList(listValues);
388+
LbugList list = new LbugList(listValues);
389389
assertEquals(listValues.length, list.getListSize());
390390
for (int i = 0; i < list.getListSize(); ++i) {
391-
KuzuList nestedList = new KuzuList(list.getListElement(i));
391+
LbugList nestedList = new LbugList(list.getListElement(i));
392392
for (int j = 0; j < nestedListValues[i].length; ++j) {
393393
assertEquals(nestedListValues[i].length, nestedList.getListSize());
394394
assertEquals((Integer) nestedListValues[i][j].getValue(),
@@ -421,7 +421,7 @@ void CreateListLiteralNested() {
421421
@Test
422422
void CreateListDefaultValues() {
423423
int listLength = 5;
424-
KuzuList list = new KuzuList(new DataType(DataTypeID.INT32), listLength);
424+
LbugList list = new LbugList(new DataType(DataTypeID.INT32), listLength);
425425
assertEquals(listLength, list.getListSize());
426426
for (int i = 0; i < listLength; ++i) {
427427
assertEquals(0, (Integer) list.getListElement(i).getValue());
@@ -442,7 +442,7 @@ void ValueGetListSize() {
442442

443443
assertTrue(value.isOwnedByCPP());
444444
assertFalse(value.isNull());
445-
KuzuList list = new KuzuList(value);
445+
LbugList list = new LbugList(value);
446446
assertEquals(list.getListSize(), 2);
447447

448448
value.close();
@@ -462,7 +462,7 @@ void ValueGetListElement() {
462462
assertTrue(value.isOwnedByCPP());
463463
assertFalse(value.isNull());
464464

465-
KuzuList list = new KuzuList(value);
465+
LbugList list = new LbugList(value);
466466
assertEquals(list.getListSize(), 2);
467467

468468
Value listElement = list.getListElement(0);
@@ -1161,7 +1161,7 @@ void RelValToString() {
11611161
void CreateStructLiteral() {
11621162
String[] fieldNames = { "name", "ID", "age" };
11631163
Value[] fieldValues = { new Value("Alice"), new Value(1), new Value(20) };
1164-
KuzuStruct structVal = new KuzuStruct(fieldNames, fieldValues);
1164+
LbugStruct structVal = new LbugStruct(fieldNames, fieldValues);
11651165
assertEquals(fieldNames.length, structVal.getNumFields());
11661166
for (int i = 0; i < fieldNames.length; ++i) {
11671167
assertEquals(fieldNames[i], structVal.getFieldNameByIndex(i));
@@ -1185,13 +1185,13 @@ void CreateStructLiteral() {
11851185
void CreateStructLiteralNested() {
11861186
String[] personFieldNames = { "name", "ID" };
11871187
Value[] personFieldValues = { new Value("Alice"), new Value(1) };
1188-
KuzuStruct person = new KuzuStruct(personFieldNames, personFieldValues);
1188+
LbugStruct person = new LbugStruct(personFieldNames, personFieldValues);
11891189

11901190
String[] companyFieldNames = { "name", "boss" };
11911191
Value[] companyFieldValues = { new Value("Company"), person.getValue() };
1192-
KuzuStruct company = new KuzuStruct(companyFieldNames, companyFieldValues);
1192+
LbugStruct company = new LbugStruct(companyFieldNames, companyFieldValues);
11931193

1194-
KuzuStruct actualPerson = new KuzuStruct(company.getValueByFieldName("boss"));
1194+
LbugStruct actualPerson = new LbugStruct(company.getValueByFieldName("boss"));
11951195
assertEquals(personFieldNames.length, actualPerson.getNumFields());
11961196
for (int i = 0; i < personFieldNames.length; ++i) {
11971197
assertEquals(personFieldNames[i], actualPerson.getFieldNameByIndex(i));
@@ -1220,7 +1220,7 @@ void CreateStructLiteralFromMap() {
12201220
"name", new Value("Alice"),
12211221
"ID", new Value(2),
12221222
"age", new Value(20));
1223-
KuzuStruct structVal = new KuzuStruct(fields);
1223+
LbugStruct structVal = new LbugStruct(fields);
12241224
assertEquals(fields.size(), structVal.getNumFields());
12251225
for (Map.Entry<String, Value> expectedField : fields.entrySet()) {
12261226
String fieldName = expectedField.getKey();
@@ -1255,7 +1255,7 @@ void StructValGetNumFields() {
12551255
FlatTuple flatTuple = result.getNext();
12561256
Value value = flatTuple.getValue(0);
12571257
assertTrue(value.isOwnedByCPP());
1258-
KuzuStruct structVal = new KuzuStruct(value);
1258+
LbugStruct structVal = new LbugStruct(value);
12591259
assertEquals(structVal.getNumFields(), 14);
12601260
value.close();
12611261
flatTuple.close();
@@ -1305,7 +1305,7 @@ void StructValGetIndexByFieldName() {
13051305
FlatTuple flatTuple = result.getNext();
13061306
Value value = flatTuple.getValue(0);
13071307
assertTrue(value.isOwnedByCPP());
1308-
KuzuStruct structVal = new KuzuStruct(value);
1308+
LbugStruct structVal = new LbugStruct(value);
13091309
assertEquals(structVal.getIndexByFieldName("NOT_EXIST"), -1);
13101310

13111311
assertEquals(structVal.getIndexByFieldName("rating"), 0);
@@ -1331,7 +1331,7 @@ void StructValGetFieldNameByIndex() {
13311331
FlatTuple flatTuple = result.getNext();
13321332
Value value = flatTuple.getValue(0);
13331333
assertTrue(value.isOwnedByCPP());
1334-
KuzuStruct structVal = new KuzuStruct(value);
1334+
LbugStruct structVal = new LbugStruct(value);
13351335
assertNull(structVal.getFieldNameByIndex(1024));
13361336
assertNull(structVal.getFieldNameByIndex(-1));
13371337
assertEquals(structVal.getFieldNameByIndex(0), "rating");
@@ -1357,7 +1357,7 @@ void StructValGetValueByFieldName() {
13571357
FlatTuple flatTuple = result.getNext();
13581358
Value value = flatTuple.getValue(0);
13591359
assertTrue(value.isOwnedByCPP());
1360-
KuzuStruct structVal = new KuzuStruct(value);
1360+
LbugStruct structVal = new LbugStruct(value);
13611361
Value fieldValue = structVal.getValueByFieldName("NOT_EXIST");
13621362
assertNull(fieldValue);
13631363
fieldValue = structVal.getValueByFieldName("rating");
@@ -1378,7 +1378,7 @@ void StructValGetValueByIndex() {
13781378
FlatTuple flatTuple = result.getNext();
13791379
Value value = flatTuple.getValue(0);
13801380
assertTrue(value.isOwnedByCPP());
1381-
KuzuStruct structVal = new KuzuStruct(value);
1381+
LbugStruct structVal = new LbugStruct(value);
13821382
Value fieldValue = structVal.getValueByIndex(1024);
13831383
assertNull(fieldValue);
13841384
fieldValue = structVal.getValueByIndex(-1);
@@ -1397,7 +1397,7 @@ void StructValGetValueByIndex() {
13971397
void CreateMapLiteral() {
13981398
Value[] keys = { new Value("Alice"), new Value("Bob") };
13991399
Value[] values = { new Value(1), new Value(2) };
1400-
KuzuMap lbugMap = new KuzuMap(keys, values);
1400+
LbugMap lbugMap = new LbugMap(keys, values);
14011401
assertEquals(keys.length, lbugMap.getNumFields());
14021402
int aliceKeyIdx = (lbugMap.getKey(0).getValue().equals("Alice")) ? 0 : 1;
14031403
int bobKeyIdx = 1 - aliceKeyIdx;
@@ -1420,15 +1420,15 @@ void CreateMapLiteral() {
14201420
void CreateMapLiteralNested() {
14211421
Value[][] nestedKeys = { { new Value("Alice"), new Value("Bob") }, { new Value("Carol"), new Value("Dan") } };
14221422
Value[][] nestedValues = { { new Value(1), new Value(2) }, { new Value(3), new Value(4) } };
1423-
KuzuMap map0 = new KuzuMap(nestedKeys[0], nestedValues[0]);
1424-
KuzuMap map1 = new KuzuMap(nestedKeys[1], nestedValues[1]);
1423+
LbugMap map0 = new LbugMap(nestedKeys[0], nestedValues[0]);
1424+
LbugMap map1 = new LbugMap(nestedKeys[1], nestedValues[1]);
14251425
Value[] nestedMaps = { map0.getValue(), map1.getValue() };
14261426

14271427
Value[] keys = { new Value(Long.valueOf(0)), new Value(Long.valueOf(1)) };
1428-
KuzuMap lbugMap = new KuzuMap(keys, nestedMaps);
1428+
LbugMap lbugMap = new LbugMap(keys, nestedMaps);
14291429
assertEquals(keys.length, lbugMap.getNumFields());
14301430

1431-
KuzuMap map1Actual = new KuzuMap(lbugMap.getValue(1));
1431+
LbugMap map1Actual = new LbugMap(lbugMap.getValue(1));
14321432
int carolKeyIdx = (map1Actual.getKey(0).getValue().equals("Carol")) ? 0 : 1;
14331433
int danKeyIdx = 1 - carolKeyIdx;
14341434
assertEquals("Carol", map1Actual.getKey(carolKeyIdx).getValue());
@@ -1470,15 +1470,15 @@ void MapValGetNumFields() {
14701470
FlatTuple flatTuple = result.getNext();
14711471
Value value = flatTuple.getValue(0);
14721472
assertTrue(value.isOwnedByCPP());
1473-
KuzuMap mapVal = new KuzuMap(value);
1473+
LbugMap mapVal = new LbugMap(value);
14741474
assertEquals(mapVal.getNumFields(), 2);
14751475
value.close();
14761476
flatTuple.close();
14771477
mapVal.close();
14781478

14791479
flatTuple = result.getNext();
14801480
value = flatTuple.getValue(0);
1481-
mapVal = new KuzuMap(value);
1481+
mapVal = new LbugMap(value);
14821482
assertTrue(value.isOwnedByCPP());
14831483
assertEquals(mapVal.getNumFields(), 0);
14841484
value.close();
@@ -1487,7 +1487,7 @@ void MapValGetNumFields() {
14871487

14881488
flatTuple = result.getNext();
14891489
value = flatTuple.getValue(0);
1490-
mapVal = new KuzuMap(value);
1490+
mapVal = new LbugMap(value);
14911491
assertTrue(value.isOwnedByCPP());
14921492
assertEquals(mapVal.getNumFields(), 1);
14931493
value.close();
@@ -1506,7 +1506,7 @@ void MapValGetKey() {
15061506
FlatTuple flatTuple = result.getNext();
15071507
Value value = flatTuple.getValue(0);
15081508
assertTrue(value.isOwnedByCPP());
1509-
KuzuMap mapVal = new KuzuMap(value);
1509+
LbugMap mapVal = new LbugMap(value);
15101510
Value key = mapVal.getKey(0);
15111511
String fieldName = key.getValue();
15121512
assertEquals(fieldName, "audience1");
@@ -1551,7 +1551,7 @@ void MapValGetValue() {
15511551
FlatTuple flatTuple = result.getNext();
15521552
Value value = flatTuple.getValue(0);
15531553
assertTrue(value.isOwnedByCPP());
1554-
KuzuMap mapVal = new KuzuMap(value);
1554+
LbugMap mapVal = new LbugMap(value);
15551555
Value fieldValue = mapVal.getValue(1024);
15561556
assertNull(fieldValue);
15571557
fieldValue = mapVal.getValue(-1);
@@ -1567,7 +1567,7 @@ void MapValGetValue() {
15671567

15681568
flatTuple = result.getNext();
15691569
value = flatTuple.getValue(0);
1570-
mapVal = new KuzuMap(value);
1570+
mapVal = new LbugMap(value);
15711571
assertTrue(value.isOwnedByCPP());
15721572
fieldValue = mapVal.getValue(0);
15731573
assertNull(fieldValue);
@@ -1577,7 +1577,7 @@ void MapValGetValue() {
15771577

15781578
flatTuple = result.getNext();
15791579
value = flatTuple.getValue(0);
1580-
mapVal = new KuzuMap(value);
1580+
mapVal = new LbugMap(value);
15811581
assertTrue(value.isOwnedByCPP());
15821582
fieldValue = mapVal.getValue(0);
15831583
assertEquals((long) fieldValue.getValue(), 33);
@@ -1604,14 +1604,14 @@ void RecursiveRelGetNodeAndRelList() {
16041604

16051605
try (Value nodeListValue = ValueRecursiveRelUtil.getNodeList(value)) {
16061606
assertTrue(nodeListValue.isOwnedByCPP());
1607-
KuzuList nodeList = new KuzuList(nodeListValue);
1607+
LbugList nodeList = new LbugList(nodeListValue);
16081608
assertEquals(nodeList.getListSize(), 0);
16091609
nodeList.close();
16101610
}
16111611

16121612
try (Value relListValue = ValueRecursiveRelUtil.getRelList(value)) {
16131613
assertTrue(relListValue.isOwnedByCPP());
1614-
KuzuList relList = new KuzuList(relListValue);
1614+
LbugList relList = new LbugList(relListValue);
16151615
assertEquals(relList.getListSize(), 1);
16161616

16171617
try (Value rel = relList.getListElement(0)) {

0 commit comments

Comments
 (0)