Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Commit

Permalink
rename RemoteFileSystemService to ThriftFileSystemService
Browse files Browse the repository at this point in the history
Summary: `FileSystemService` is the current remote Nuclide RPC service. `RemoteFileSystemService` is the new Thrift-based remote Nuclide RPC service. Rename `RemoteFileSystemService` to be less ambiguous.

Reviewed By: semmypurewal

Differential Revision: D9492935

fbshipit-source-id: 8e28d6ba3f10b7072c87c35c389709f392b2161d
  • Loading branch information
cs01 authored and facebook-github-bot committed Aug 27, 2018
1 parent 989bd45 commit d05bb88
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 256 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const commonWatchIgnoredExpressions = [
/**
* Create a service handler class to manage server methods
*/
export class RemoteFileSystemServiceHandler {
export class ThriftFileSystemServiceHandler {
_fileChangeEvents: Array<filesystem_types.FileChangeEvent>;
_logger: log4js$Logger;
_watcher: WatchmanClient;
Expand Down
2 changes: 1 addition & 1 deletion modules/big-dig/src/services/fs/filesystem.thrift
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ struct CopyOpt{
}


service RemoteFileSystemService {
service ThriftFileSystemService {

/**
* Initialize watcher for target file or directory.
Expand Down
3 changes: 3 additions & 0 deletions modules/big-dig/src/services/fs/fs-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ def add_header(fpath: Path) -> None:
with open(fpath, "r") as f:
content = f.read()

if content.startswith(header):
return

with open(fpath, "w") as f:
f.write(header + content)

Expand Down
10 changes: 5 additions & 5 deletions modules/big-dig/src/services/fs/fsServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
*/

import thrift from 'thrift';
import RemoteFileSystemService from './gen-nodejs/RemoteFileSystemService';
import {RemoteFileSystemServiceHandler} from './RemoteFileSystemServiceHandler';
import ThriftFileSystemService from './gen-nodejs/ThriftFileSystemService';
import {ThriftFileSystemServiceHandler} from './ThriftFileSystemServiceHandler';
import {scanPortsToListen} from '../../common/ports';
import {getLogger} from 'log4js';
import {WatchmanClient} from 'nuclide-watchman-helpers';
Expand All @@ -22,7 +22,7 @@ import {WatchmanClient} from 'nuclide-watchman-helpers';
* e.g. initialze(), close() etc.
*/
export class RemoteFileSystemServer {
_serviceHandler: RemoteFileSystemServiceHandler;
_serviceHandler: ThriftFileSystemServiceHandler;
_server: thrift.Server;
_port: number;
_logger: log4js$Logger;
Expand All @@ -32,14 +32,14 @@ export class RemoteFileSystemServer {
this._port = port;
this._logger = getLogger('fs-thrift-server');
this._watcher = new WatchmanClient();
this._serviceHandler = new RemoteFileSystemServiceHandler(this._watcher);
this._serviceHandler = new ThriftFileSystemServiceHandler(this._watcher);
}

async initialize(): Promise<void> {
if (this._server != null) {
return;
}
this._server = thrift.createServer(RemoteFileSystemService, {
this._server = thrift.createServer(ThriftFileSystemService, {
watch: (uri, options) => {
return this._serviceHandler.watch(uri, options);
},
Expand Down
Loading

0 comments on commit d05bb88

Please sign in to comment.