Skip to content

Commit

Permalink
Merge pull request #845 from terascope/publish-deps
Browse files Browse the repository at this point in the history
v0.42.2 update packages and a few minor changes
  • Loading branch information
jsnoble authored Oct 4, 2018
2 parents ab6732c + c47f244 commit edd20c0
Show file tree
Hide file tree
Showing 20 changed files with 295 additions and 375 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"publish:changed": "./scripts/publish.sh"
},
"dependencies": {
"lerna": "^3.4.0",
"lerna": "^3.4.1",
"typescript": "^3.1.1"
},
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/jest": "^23.3.3",
"babel-core": "^6.0.0",
"babel-jest": "^23.6.0",
"eslint": "^5.6.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/elasticsearch-api/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"publishConfig": {
"access": "public"
},
"version": "1.1.1",
"version": "1.1.2",
"description": "",
"main": "index.js",
"scripts": {
Expand All @@ -21,7 +21,7 @@
"url": "https://github.com/terascope/teraslice/issues"
},
"dependencies": {
"@terascope/error-parser": "^1.0.0",
"@terascope/error-parser": "^1.0.1",
"bluebird": "^3.5.2",
"lodash": "^4.17.11",
"uuid": "^3.3.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/error-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@terascope/error-parser",
"version": "1.0.0",
"version": "1.0.1",
"description": "Generic error parser",
"main": "index.js",
"publishConfig": {
Expand Down
10 changes: 5 additions & 5 deletions packages/job-components/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@terascope/job-components",
"version": "0.5.0",
"version": "0.5.1",
"publishConfig": {
"access": "public"
},
Expand Down Expand Up @@ -36,11 +36,11 @@
"test:debug": "env DEBUG='*teraslice*' jest --detectOpenHandles --coverage=false --runInBand"
},
"dependencies": {
"@terascope/queue": "^1.1.3",
"@terascope/teraslice-types": "^0.2.0",
"@terascope/queue": "^1.1.4",
"@terascope/teraslice-types": "^0.2.1",
"@types/fs-extra": "^5.0.4",
"@types/lodash": "^4.14.116",
"@types/node": "^10.11.3",
"@types/node": "^10.11.4",
"@types/uuid": "^3.4.4",
"datemath-parser": "^1.0.6",
"fs-extra": "^7.0.0",
Expand All @@ -50,7 +50,7 @@
"uuid": "^3.3.2"
},
"devDependencies": {
"@types/jest": "^23.3.2",
"@types/jest": "^23.3.3",
"babel-core": "^6.0.0",
"babel-jest": "^23.6.0",
"jest": "^23.6.0",
Expand Down
27 changes: 6 additions & 21 deletions packages/job-components/src/operations/core/slicer-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default abstract class SlicerCore extends Core {
*/
static isRecoverable: boolean = true;

private readonly queue: Queue;
private readonly queue: Queue<Slice>;
protected recoveryData: object[];
protected readonly opConfig: Readonly<OpConfig>;

Expand Down Expand Up @@ -64,33 +64,23 @@ export default abstract class SlicerCore extends Core {
* This will be enqueued and dequeued by the "Execution Controller"
*/
createSlice(input: Slice|SliceRequest, order: number, id: number = 0) {
let slice: Slice;
let needsState = false;

// recovery slices already have correct meta data
if (input.slice_id) {
slice = input as Slice;
this.queue.enqueue(input as Slice);
} else {
needsState = true;
slice = {
this.queue.enqueue({
slice_id: uuidv4(),
request: input,
slicer_id: id,
slicer_order: order,
_created: new Date().toISOString()
};
request: input,
} as Slice);
}

this.queue.enqueue({
needsState,
slice
});
}

/**
* A method called by the "Execution Controller" to dequeue a created "Slice"
*/
getSlice(): EnqueuedSlice|null {
getSlice(): Slice|null {
return this.queue.dequeue();
}

Expand Down Expand Up @@ -127,8 +117,3 @@ export interface SliceResult {
retry?: boolean;
error?: string;
}

export interface EnqueuedSlice {
slice: Slice;
needsState: boolean;
}
2 changes: 1 addition & 1 deletion packages/job-components/src/operations/parallel-slicer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default abstract class ParallelSlicer extends SlicerCore {
slicer.done = true;
} else {
if (_.isArray(result)) {
this.events.emit('execution:subslice');
this.events.emit('slicer:subslice');
_.each(result, (item) => {
slicer.order += 1;
this.createSlice(item, slicer.order, slicer.id);
Expand Down
2 changes: 1 addition & 1 deletion packages/job-components/src/operations/slicer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default abstract class Slicer extends SlicerCore {
}

if (_.isArray(result)) {
this.events.emit('execution:subslice');
this.events.emit('slicer:subslice');
_.each(result, (item) => {
this.order += 1;
this.createSlice(item, this.order);
Expand Down
Loading

0 comments on commit edd20c0

Please sign in to comment.