1 /*
2  * Licensed to the Apache Software Foundation (ASF) under one
3  * or more contributor license agreements.  See the NOTICE file
4  * distributed with this work for additional information
5  * regarding copyright ownership.  The ASF licenses this file
6  * to you under the Apache License, Version 2.0 (the
7  * "License"); you may not use this file except in compliance
8  * with the License.  You may obtain a copy of the License at
9  *
10  *     http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 package org.apache.hadoop.mapreduce.v2.hs;
20 
21 import java.io.IOException;
22 
23 import org.apache.hadoop.classification.InterfaceAudience.Private;
24 import org.apache.hadoop.classification.InterfaceStability.Unstable;
25 import org.apache.hadoop.conf.Configuration;
26 import org.apache.hadoop.mapreduce.v2.api.MRDelegationTokenIdentifier;
27 import org.apache.hadoop.security.token.delegation.DelegationKey;
28 
29 @Private
30 @Unstable
31 public class HistoryServerNullStateStoreService
32     extends HistoryServerStateStoreService {
33 
34   @Override
initStorage(Configuration conf)35   protected void initStorage(Configuration conf) throws IOException {
36     // Do nothing
37   }
38 
39   @Override
startStorage()40   protected void startStorage() throws IOException {
41     // Do nothing
42   }
43 
44   @Override
closeStorage()45   protected void closeStorage() throws IOException {
46     // Do nothing
47   }
48 
49   @Override
loadState()50   public HistoryServerState loadState() throws IOException {
51     throw new UnsupportedOperationException(
52         "Cannot load state from null store");
53   }
54 
55   @Override
storeToken(MRDelegationTokenIdentifier tokenId, Long renewDate)56   public void storeToken(MRDelegationTokenIdentifier tokenId, Long renewDate)
57       throws IOException {
58     // Do nothing
59   }
60 
61   @Override
updateToken(MRDelegationTokenIdentifier tokenId, Long renewDate)62   public void updateToken(MRDelegationTokenIdentifier tokenId, Long renewDate)
63       throws IOException {
64     // Do nothing
65   }
66 
67   @Override
removeToken(MRDelegationTokenIdentifier tokenId)68   public void removeToken(MRDelegationTokenIdentifier tokenId)
69       throws IOException {
70     // Do nothing
71   }
72 
73   @Override
storeTokenMasterKey(DelegationKey key)74   public void storeTokenMasterKey(DelegationKey key) throws IOException {
75     // Do nothing
76   }
77 
78   @Override
removeTokenMasterKey(DelegationKey key)79   public void removeTokenMasterKey(DelegationKey key) throws IOException {
80     // Do nothing
81   }
82 }
83