Github user danny0405 commented on a diff in the pull request:

    https://github.com/apache/storm/pull/2433#discussion_r173615818
  
    --- Diff: 
storm-server/src/main/java/org/apache/storm/daemon/supervisor/Supervisor.java 
---
    @@ -234,6 +295,60 @@ public void launchDaemon() {
             }
         }
     
    +    private void launchSupervisorThriftServer(Map conf) throws IOException 
{
    +        // validate port
    +        int port = getThriftServerPort();
    +        try {
    +            ServerSocket socket = new ServerSocket(port);
    +            socket.close();
    +        } catch (BindException e) {
    +            LOG.error("{} is not available. Check if another process is 
already listening on {}", port, port);
    +            throw new RuntimeException(e);
    +        }
    +
    +        TProcessor processor = new 
org.apache.storm.generated.Supervisor.Processor(
    +                new org.apache.storm.generated.Supervisor.Iface() {
    +                    @Override
    +                    public void 
sendSupervisorAssignments(SupervisorAssignments assignments)
    +                            throws AuthorizationException, TException {
    +                        LOG.info("Got an assignments from master, will 
start to sync with assignments: {}", assignments);
    +                        SynchronizeAssignments syn = new 
SynchronizeAssignments(getSupervisor(), assignments, getReadClusterState());
    +                        getEventManger().add(syn);
    +                    }
    +
    +                    @Override
    +                    public Assignment getLocalAssignmentForStorm(String id)
    +                            throws NotAliveException, 
AuthorizationException, TException {
    +                        Assignment assignment = 
getStormClusterState().assignmentInfo(id, null);
    +                        if (null == assignment) {
    +                            throw new NotAliveException("No local 
assignment assigned for storm: " + id + " for node: " + getHostName());
    +                        }
    +                        return assignment;
    +                    }
    +
    +                    @Override
    +                    public void 
sendSupervisorWorkerHeartbeat(SupervisorWorkerHeartbeat heartbeat)
    +                            throws AuthorizationException, TException {
    +                        // do nothing now
    +                    }
    --- End diff --
    
    This is where the authorization should take place, but i'm not familia with 
the auth thing.


---

Reply via email to