Skip to content

Commit 76ccc3e

Browse files
committed
Updates to samples
1 parent f915a46 commit 76ccc3e

File tree

24 files changed

+99
-60
lines changed

24 files changed

+99
-60
lines changed

samples/ConfigTests/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in STREAMS_HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::ConfigTest
1717

1818
all: standalone
1919

20-
standalone:
20+
data:
21+
mkdir data
22+
23+
standalone: data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
distributed:
26+
distributed: data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
clean:

samples/DeleteSample/Makefile

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Fill in HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
@@ -19,16 +19,19 @@ SPL_MAIN_COMPOSITE_VERSIONDEL = com.ibm.streamsx.hbase.sample::DeleteAll
1919

2020
all: standalone_delete standalone_check standalone_version
2121

22-
standalone_delete:
22+
data:
23+
mkdir data
24+
25+
standalone_delete: data
2326
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE_DELETE) $(SPL_CMD_ARGS) --output-dir output_plain
2427

25-
standalone_check:
28+
standalone_check: data
2629
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE_CHECK) $(SPL_CMD_ARGS) --output-dir output_check
2730

28-
standalone_version:
31+
standalone_version: data
2932
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE_VERSIONDEL) $(SPL_CMD_ARGS) --output-dir output_version
3033

31-
distributed:
34+
distributed: data
3235
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE_DELETE) $(SPL_CMD_ARGS)
3336
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE_CHECK) $(SPL_CMD_ARGS)
3437
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE_VERSIONDEL) $(SPL_CMD_ARGS)

samples/DeleteSample/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<info:identity>
77
<info:name>DeleteSample</info:name>
88
<info:description>Demostrates the use of com.ibm.streamsx.hbase::HBASEDelete, including how to do checkAndDelete </info:description>
9-
<info:version>1.0.0</info:version>
9+
<info:version>1.0.1</info:version>
1010
<info:requiredProductVersion>3.2.0</info:requiredProductVersion>
1111
</info:identity>
1212
<info:dependencies>
@@ -15,4 +15,4 @@
1515
<common:version>1.0.0</common:version>
1616
</info:toolkit>
1717
</info:dependencies>
18-
</info:toolkitInfoModel>
18+
</info:toolkitInfoModel>

samples/GetRecord/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in STREAMS_HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::GetRecord
1717

1818
all: standalone
1919

20-
standalone:
20+
data:
21+
mkdir data
22+
23+
standalone: data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
distributed:
26+
distributed: data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
clean:

samples/GetRecord/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<info:identity>
99
<info:name>GetRecord</info:name>
1010
<info:description>Demonstrate how to populate a tuple using HBASEGet</info:description>
11-
<info:version>1.0.0</info:version>
11+
<info:version>1.0.1</info:version>
1212
<info:requiredProductVersion>3.2.1.0</info:requiredProductVersion>
1313
</info:identity>
1414
<info:dependencies>

samples/GetSample/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in STREAMS_HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::GetSample
1717

1818
all: standalone
1919

20-
standalone:
20+
data:
21+
mkdir data
22+
23+
standalone: data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
distributed:
26+
distributed: data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
clean:

samples/GetSample/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<info:identity>
88
<info:name>GetSample</info:name>
99
<info:description>Demonstrates the use com.ibm.streamsx.hbase.HBASEGet</info:description>
10-
<info:version>1.0.0</info:version>
10+
<info:version>1.0.1</info:version>
1111
<info:requiredProductVersion>3.0.0</info:requiredProductVersion>
1212
</info:identity>
1313
<info:dependencies>
@@ -16,4 +16,4 @@
1616
<common:version>1.0.0</common:version>
1717
</info:toolkit>
1818
</info:dependencies>
19-
</info:toolkitInfoModel>
19+
</info:toolkitInfoModel>

samples/IncrementSample/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::CountProperNouns
1717

1818
all: standalone
1919

20-
standalone:
20+
data:
21+
mkdir data
22+
23+
standalone: data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
distributed:
26+
distributed: data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
clean:

samples/IncrementSample/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ All Rights Reserved
77
<info:identity>
88
<info:name>IncrementSample</info:name>
99
<info:description>Demonstrates the use of com.ibm.streamsx.HBASEIncrement by using it to count word mentions in the Iliad</info:description>
10-
<info:version>1.0.0</info:version>
10+
<info:version>1.0.1</info:version>
1111
<info:requiredProductVersion>3.0.0</info:requiredProductVersion>
1212
</info:identity>
1313
<info:dependencies>

samples/MultiTypeRecord/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111
SOURCES = com.ibm.streamsx.hbase.sample/MultiTypeGet.spl com.ibm.streamsx.hbase.sample/MultiTypeRecord.spl com.ibm.streamsx.hbase.sample/PutBookRecord.spl com.ibm.streamsx.hbase.sample/ScanTableWithBlob.spl com.ibm.streamsx.hbase.sample/WriteTuples.spl
12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= --data-directory data -a
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::MultiTypeRecord
1717

1818
all: standalone
1919

20-
output/bin/standalone: $(SOURCES)
20+
data:
21+
mkdir data
22+
23+
output/bin/standalone: $(SOURCES) data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
output/com.ibm.streamsx.hbase.sample.MultiTypeRecord.adl: $(SOURCES)
26+
output/com.ibm.streamsx.hbase.sample.MultiTypeRecord.adl: $(SOURCES) data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
standalone: output/bin/standalone

samples/MultiTypeRecord/com.ibm.streamsx.hbase.sample/PutBookRecord.spl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,14 @@ use com.ibm.streamsx.hbase::HBASEPut ;
1111
stateful blob getFileContents(rstring filename)
1212
{
1313
mutable int32 error = 0 ;
14-
uint64 file = spl.file::fopen(filename, "r", error) ;
15-
assert(error == 0) ;
14+
rstring absFile = dataDirectory()+"/"+filename;
15+
appTrc(Trace.info,"Absolute path for file "+filename+" is "+absFile);
16+
uint64 file = spl.file::fopen(absFile, "r", error) ;
17+
assert(error == 0,"File "+filename+" (absolute path: "+absFile+") failed to open with code "+(rstring)error) ;
1618
mutable blob toReturn = [ ] ;
1719
spl.file::freadfile(toReturn, file, error) ;
18-
assert(error == 0) ;
20+
assert(error == 0,"File "+filename+" (absolute path: "+absFile+") could not be read, error code "+(rstring)error) ;
21+
spl.file::fclose(file,error);
1922
return toReturn ;
2023
}
2124

samples/MultiTypeRecord/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<info:identity>
88
<info:name>MultiTypeRecord</info:name>
99
<info:description>This sample demonstrates the HBASE operators handling a variety of data types. It is the next iteration of the PutRecord,GetRecord, and ScanRecord sample. This sample shows how to Put, Get, and Scan an HBASE table. The objects being added are books, with a columnQualifier for title, author, year, and compressed data representing the first chapter. </info:description>
10-
<info:version>1.0.0</info:version>
10+
<info:version>1.0.1</info:version>
1111
<info:requiredProductVersion>3.2.1.0</info:requiredProductVersion>
1212
</info:identity>
1313
<info:dependencies>

samples/PutRecord/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in STREAMS_HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::PutRecord
1717

1818
all: standalone
1919

20-
standalone:
20+
data:
21+
mkdir data
22+
23+
standalone: data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
distributed:
26+
distributed: data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
clean:

samples/PutRecord/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<info:identity>
77
<info:name>PutRecord</info:name>
88
<info:description></info:description>
9-
<info:version>1.0.0</info:version>
9+
<info:version>1.0.1</info:version>
1010
<info:requiredProductVersion>3.2.1.0</info:requiredProductVersion>
1111
</info:identity>
1212
<info:dependencies>

samples/PutSample/Makefile

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# Fill in STREAMS_HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
@@ -21,20 +21,23 @@ SPL_MAIN_PUT=com.ibm.streamsx.hbase.sample::PutSample
2121

2222
all: standalone_update standalone_check standalone_exist standalone_put
2323

24-
standalone_update:
24+
data:
25+
mkdir data
26+
27+
standalone_update: data
2528
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_UPDATE) $(SPL_CMD_ARGS) --output-dir output_update
2629

27-
standalone_check:
30+
standalone_check: data
2831
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_CHECK) $(SPL_CMD_ARGS) --output-dir output_check
2932

30-
standalone_exist:
33+
standalone_exist: data
3134
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_EXIST_CHECK) $(SPL_CMD_ARGS) --output-dir output_check_exist
3235

33-
standalone_put:
36+
standalone_put: data
3437
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_PUT) $(SPL_CMD_ARGS) --output-dir output_put
3538

3639

37-
distributed:
40+
distributed: data
3841
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_UPDATE) $(SPL_CMD_ARGS)
3942
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_CHECK) $(SPL_CMD_ARGS)
4043
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_EXIST_CHECK) $(SPL_CMD_ARGS)

samples/PutSample/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<info:identity>
88
<info:name>PutSample</info:name>
99
<info:description>Demonstrates the use of HBASEPut for both ordinary put and checkAndPut.</info:description>
10-
<info:version>1.0.0</info:version>
10+
<info:version>1.0.1</info:version>
1111
<info:requiredProductVersion>3.2.0</info:requiredProductVersion>
1212
</info:identity>
1313
<info:dependencies>
@@ -16,4 +16,4 @@
1616
<common:version>1.0.0</common:version>
1717
</info:toolkit>
1818
</info:dependencies>
19-
</info:toolkitInfoModel>
19+
</info:toolkitInfoModel>

samples/ScanBooks/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,21 @@
99
# Fill in STREAMS_HBASE_TOOLKIT location here.
1010
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1111

12-
SPLC_FLAGS = -a
12+
SPLC_FLAGS ?= -a --data-directory data
1313
SPLC = $(STREAMS_INSTALL)/bin/sc
1414

1515
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1616
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::ScanBooks
1717

1818
all: standalone
1919

20-
standalone:
20+
data:
21+
mkdir data
22+
23+
standalone: data
2124
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2225

23-
distributed:
26+
distributed: data
2427
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2528

2629
clean:

samples/ScanBooks/info.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
<info:identity>
88
<info:name>ScanRecord</info:name>
99
<info:description>Demonstrate how to use HBASEScan to populate a tuple</info:description>
10-
<info:version>1.0.0</info:version>
10+
<info:version>1.0.1</info:version>
1111
<info:requiredProductVersion>3.2.1.0</info:requiredProductVersion>
1212
</info:identity>
1313
<info:dependencies>

samples/TableScan/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,21 @@
1111
# Fill in HBASE_TOOLKIT location here.
1212
STREAMS_HBASE_TOOLKIT ?= ../../com.ibm.streamsx.hbase
1313

14-
SPLC_FLAGS = -a
14+
SPLC_FLAGS ?= -a --data-directory data
1515
SPLC = $(STREAMS_INSTALL)/bin/sc
1616

1717
SPL_CMD_ARGS ?= -t $(STREAMS_HBASE_TOOLKIT)
1818
SPL_MAIN_COMPOSITE = com.ibm.streamsx.hbase.sample::ScanString
1919

2020
all: standalone
2121

22-
standalone:
22+
data:
23+
mkdir data
24+
25+
standalone: data
2326
$(SPLC) $(SPLC_FLAGS) -T -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2427

25-
distributed:
28+
distributed: data
2629
$(SPLC) $(SPLC_FLAGS) -M $(SPL_MAIN_COMPOSITE) $(SPL_CMD_ARGS)
2730

2831
clean:

samples/TableScan/info.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<info:identity>
77
<info:name>TableScanSample</info:name>
88
<info:description>Demonstrates how to scan a table.</info:description>
9-
<info:version>1.0.0</info:version>
9+
<info:version>1.0.1</info:version>
1010
<info:requiredProductVersion>3.0.0</info:requiredProductVersion>
1111
</info:identity>
1212
<info:dependencies>
@@ -15,4 +15,4 @@
1515
<common:version>1.0.0</common:version>
1616
</info:toolkit>
1717
</info:dependencies>
18-
</info:toolkitInfoModel>
18+
</info:toolkitInfoModel>

0 commit comments

Comments
 (0)